From c15e3645f605c23b0b5d54b64a0c85e9d9a3fbbc Mon Sep 17 00:00:00 2001 From: Wonsang Ryou Date: Fri, 14 Apr 2017 08:51:29 +0900 Subject: [PATCH] build: fix 'make clean' This patch fixes the problem that some *.o files aren't cleaned after "make clean" in mqtt and sss modules. The "CLEAN" function of Makefile cleans object files only in current directory. That's why the files of sub directories aren't cleaned by "CLEAN" function. This patch all object files make be generated in the directory in which Makefile exists. Change-Id: I50d9f95ca255b2c0d1aaf33a470f4d2f4ab5bb40 Signed-off-by: Wonsang Ryou --- apps/netutils/mqtt/Makefile | 40 +++++++++++++++++++++------------------- os/arch/arm/src/s5j/Make.defs | 5 ++++- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/apps/netutils/mqtt/Makefile b/apps/netutils/mqtt/Makefile index 3f6273a..b1549a4 100644 --- a/apps/netutils/mqtt/Makefile +++ b/apps/netutils/mqtt/Makefile @@ -62,23 +62,24 @@ CSRCS = CSRCS += mqtt_api.c # lib directory -CSRCS += lib/tls_mosq.c -CSRCS += lib/net_mosq.c -CSRCS += lib/send_client_mosq.c -CSRCS += lib/messages_mosq.c -CSRCS += lib/util_mosq.c -CSRCS += lib/socks_mosq.c -CSRCS += lib/will_mosq.c -CSRCS += lib/mosquitto.c -CSRCS += lib/logging_mosq.c -CSRCS += lib/send_mosq.c -CSRCS += lib/read_handle_shared.c -CSRCS += lib/srv_mosq.c -CSRCS += lib/thread_mosq.c -CSRCS += lib/read_handle_client.c -CSRCS += lib/read_handle.c -CSRCS += lib/time_mosq.c -CSRCS += lib/memory_mosq.c +MQTT_LIB_DIR=lib +CSRCS += tls_mosq.c +CSRCS += net_mosq.c +CSRCS += send_client_mosq.c +CSRCS += messages_mosq.c +CSRCS += util_mosq.c +CSRCS += socks_mosq.c +CSRCS += will_mosq.c +CSRCS += mosquitto.c +CSRCS += logging_mosq.c +CSRCS += send_mosq.c +CSRCS += read_handle_shared.c +CSRCS += srv_mosq.c +CSRCS += thread_mosq.c +CSRCS += read_handle_client.c +CSRCS += read_handle.c +CSRCS += time_mosq.c +CSRCS += memory_mosq.c # include directory CFLAGS += $(MQTT_LIB_CFLAGS) @@ -103,7 +104,7 @@ ROOTDEPPATH = --dep-path . # Common build -VPATH = +VPATH = $(MQTT_LIB_DIR) all: .built .PHONY: context depend clean distclean @@ -123,7 +124,8 @@ install: context: .depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) $(MKDEP) $(ROOTDEPPATH) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \ + "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ depend: .depend diff --git a/os/arch/arm/src/s5j/Make.defs b/os/arch/arm/src/s5j/Make.defs index 264e5c1..25cbd32 100644 --- a/os/arch/arm/src/s5j/Make.defs +++ b/os/arch/arm/src/s5j/Make.defs @@ -208,7 +208,10 @@ endif CHIP_CSRCS += s5j_watchdog.c ifeq ($(CONFIG_S5J_SSS),y) -CHIP_CSRCS += chip/sss/sss_driver_io.c +VPATH += chip/sss +CHIP_CSRCS += sss_driver_io.c + +# built-in static library EXTRA_LIBS += chip/sss/libispdriver.a endif -- 2.7.4