From f074d7f376018f6f1e8ed45521299f4ae65b323b Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 16 Mar 2020 17:12:16 +0800 Subject: [PATCH] Makefile: let install depend on the target binary to ensure the binary get built and install once --- Application.mk | 1 + Makefile | 16 ++----- examples/elf/tests/errno/Makefile | 10 +++-- examples/elf/tests/hello/Makefile | 10 +++-- examples/elf/tests/helloxx/Makefile | 44 +++++++++++++------ examples/elf/tests/longjmp/Makefile | 10 +++-- examples/elf/tests/mutex/Makefile | 10 +++-- examples/elf/tests/pthread/Makefile | 10 +++-- examples/elf/tests/signal/Makefile | 10 +++-- examples/elf/tests/struct/Makefile | 10 +++-- examples/elf/tests/task/Makefile | 10 +++-- examples/module/drivers/chardev/Makefile | 10 +++-- examples/nxflat/tests/errno/Makefile | 8 ++-- examples/nxflat/tests/hello++/Makefile | 21 ++++++--- examples/nxflat/tests/hello/Makefile | 8 ++-- examples/nxflat/tests/longjmp/Makefile | 8 ++-- examples/nxflat/tests/mutex/Makefile | 8 ++-- examples/nxflat/tests/pthread/Makefile | 8 ++-- examples/nxflat/tests/signal/Makefile | 8 ++-- examples/nxflat/tests/struct/Makefile | 8 ++-- examples/nxflat/tests/task/Makefile | 8 ++-- .../posix_spawn/filesystem/hello/Makefile | 10 +++-- .../posix_spawn/filesystem/redirect/Makefile | 10 +++-- examples/sotest/lib/modprint/Makefile | 10 +++-- examples/sotest/lib/sotest/Makefile | 10 +++-- examples/thttpd/content/hello/Makefile | 8 ++-- examples/thttpd/content/tasks/Makefile | 8 ++-- tools/mksymtab.sh | 7 --- 28 files changed, 177 insertions(+), 122 deletions(-) diff --git a/Application.mk b/Application.mk index 686dc2ba6..318793908 100644 --- a/Application.mk +++ b/Application.mk @@ -151,6 +151,7 @@ PROGLIST := $(addprefix $(BINDIR)$(DELIM),$(PROGLIST)) PROGOBJ := $(MAINOBJ) $(PROGLIST): $(MAINOBJ) + $(Q) mkdir -p $(BINDIR) ifeq ($(WINTOOL),y) $(call ELFLD,$(firstword $(PROGOBJ)),"${shell cygpath -w $(firstword $(PROGLIST))}") else diff --git a/Makefile b/Makefile index 6e9072789..8f037c3be 100644 --- a/Makefile +++ b/Makefile @@ -73,17 +73,12 @@ $(foreach SDIR, $(CLEANDIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) ifeq ($(CONFIG_BUILD_KERNEL),y) -.install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install) - -install: $(BINDIR) .install - -$(BINDIR): - $(Q) mkdir -p $(BINDIR) +install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install) .import: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all) $(Q) $(MAKE) install TOPDIR="$(TOPDIR)" -import: $(BINDIR) +import: $(Q) $(MAKE) .import TOPDIR="$(APPDIR)$(DELIM)import" else @@ -114,12 +109,7 @@ endif endif # !CONFIG_BUILD_LOADABLE -.install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install) - -$(BINDIR): - $(Q) mkdir -p $(BINDIR) - -install: $(BINDIR) .install +install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install) .import: $(BIN) install diff --git a/examples/elf/tests/errno/Makefile b/examples/elf/tests/errno/Makefile index ecac55f51..ea7c54deb 100644 --- a/examples/elf/tests/errno/Makefile +++ b/examples/elf/tests/errno/Makefile @@ -82,10 +82,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/elf/tests/hello/Makefile b/examples/elf/tests/hello/Makefile index abee21907..b5b3e8512 100644 --- a/examples/elf/tests/hello/Makefile +++ b/examples/elf/tests/hello/Makefile @@ -82,10 +82,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/elf/tests/helloxx/Makefile b/examples/elf/tests/helloxx/Makefile index 24a380cb9..3c4af0933 100644 --- a/examples/elf/tests/helloxx/Makefile +++ b/examples/elf/tests/helloxx/Makefile @@ -67,15 +67,19 @@ LDLIBS += -lproxies endif BIN1 = hello++1 +ALL_BIN = $(FSIMG_DIR)/$(BIN1) BIN2 = hello++2 +ALL_BIN += $(FSIMG_DIR)/$(BIN2) ifeq ($(CONFIG_BINFMT_CONSTRUCTORS),y) BIN3 = hello++3 +ALL_BIN += $(FSIMG_DIR)/$(BIN3) ifeq ($(CONFIG_EXAMPLES_ELF_UCLIBCXX),y) BIN4 = hello++4 +ALL_BIN += $(FSIMG_DIR)/$(BIN4) BIN5 = hello++5 +ALL_BIN += $(FSIMG_DIR)/$(BIN5) endif endif -ALL_BIN = $(BIN1) $(BIN2) $(BIN3) $(BIN4) $(BIN5) SRCS1 = $(BIN1).c OBJS1 = $(SRCS1:.c=$(OBJEXT)) @@ -147,6 +151,32 @@ $(BIN5): $(OBJS5) endif endif +$(FSIMG_DIR)/$(BIN1): $(BIN1) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN1) $(FSIMG_DIR)/$(BIN1) + +$(FSIMG_DIR)/$(BIN2): $(BIN2) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN2) $(FSIMG_DIR)/$(BIN2) + +ifeq ($(CONFIG_BINFMT_CONSTRUCTORS),y) +$(FSIMG_DIR)/$(BIN3): $(BIN3) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN3) $(FSIMG_DIR)/$(BIN3) + +ifeq ($(CONFIG_EXAMPLES_ELF_UCLIBCXX),y) +$(FSIMG_DIR)/$(BIN4): $(BIN4) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN4) $(FSIMG_DIR)/$(BIN4) + +$(FSIMG_DIR)/$(BIN5): $(BIN5) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN5) $(FSIMG_DIR)/$(BIN5) +endif +endif + +install: $(ALL_BIN) + clean: $(call DELFILE, $(BIN1)) $(call DELFILE, $(BIN2)) @@ -154,15 +184,3 @@ clean: $(call DELFILE, $(BIN4)) $(call DELFILE, $(BIN5)) $(call CLEAN) - -install: $(ALL_BIN) - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN1) $(FSIMG_DIR)/$(BIN1) - $(Q) install $(BIN2) $(FSIMG_DIR)/$(BIN2) -ifeq ($(CONFIG_BINFMT_CONSTRUCTORS),y) - $(Q) install $(BIN3) $(FSIMG_DIR)/$(BIN3) -ifeq ($(CONFIG_EXAMPLES_ELF_UCLIBCXX),y) - $(Q) install $(BIN4) $(FSIMG_DIR)/$(BIN4) - $(Q) install $(BIN5) $(FSIMG_DIR)/$(BIN5) -endif -endif diff --git a/examples/elf/tests/longjmp/Makefile b/examples/elf/tests/longjmp/Makefile index c15ef4a58..c943491a2 100644 --- a/examples/elf/tests/longjmp/Makefile +++ b/examples/elf/tests/longjmp/Makefile @@ -82,10 +82,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/elf/tests/mutex/Makefile b/examples/elf/tests/mutex/Makefile index 53bf2ac5f..b864d67ef 100644 --- a/examples/elf/tests/mutex/Makefile +++ b/examples/elf/tests/mutex/Makefile @@ -82,10 +82,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/elf/tests/pthread/Makefile b/examples/elf/tests/pthread/Makefile index 26aa9f944..742c8114e 100644 --- a/examples/elf/tests/pthread/Makefile +++ b/examples/elf/tests/pthread/Makefile @@ -82,10 +82,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/elf/tests/signal/Makefile b/examples/elf/tests/signal/Makefile index e582c3220..e2f21ff41 100644 --- a/examples/elf/tests/signal/Makefile +++ b/examples/elf/tests/signal/Makefile @@ -82,10 +82,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/elf/tests/struct/Makefile b/examples/elf/tests/struct/Makefile index cdf32c0eb..bf7faebf8 100644 --- a/examples/elf/tests/struct/Makefile +++ b/examples/elf/tests/struct/Makefile @@ -83,10 +83,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/elf/tests/task/Makefile b/examples/elf/tests/task/Makefile index c46a251ef..3ebaa3b4d 100644 --- a/examples/elf/tests/task/Makefile +++ b/examples/elf/tests/task/Makefile @@ -82,10 +82,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSIMG_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSIMG_DIR) + $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) + +install: $(FSIMG_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSIMG_DIR) - $(Q) install $(BIN) $(FSIMG_DIR)/$(BIN) diff --git a/examples/module/drivers/chardev/Makefile b/examples/module/drivers/chardev/Makefile index 5b290d5cc..1144f0c18 100644 --- a/examples/module/drivers/chardev/Makefile +++ b/examples/module/drivers/chardev/Makefile @@ -88,10 +88,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDMODULEFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSROOT_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSROOT_DIR) + $(Q) install $(BIN) $(FSROOT_DIR)/$(BIN) + +install: $(FSROOT_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: $(BIN) - $(Q) mkdir -p $(FSROOT_DIR) - $(Q) install $(BIN) $(FSROOT_DIR)/$(BIN) diff --git a/examples/nxflat/tests/errno/Makefile b/examples/nxflat/tests/errno/Makefile index b63af3f52..0014e669c 100644 --- a/examples/nxflat/tests/errno/Makefile +++ b/examples/nxflat/tests/errno/Makefile @@ -69,12 +69,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/nxflat/tests/hello++/Makefile b/examples/nxflat/tests/hello++/Makefile index d14836028..ea2b8ebc2 100644 --- a/examples/nxflat/tests/hello++/Makefile +++ b/examples/nxflat/tests/hello++/Makefile @@ -39,7 +39,6 @@ BIN1 = hello++1 BIN2 = hello++2 BIN3 = hello++3 #BIN4 = hello++4 -ALL_BIN = $(BIN1) $(BIN2) $(BIN3) $(BIN4) R1SRCS1 = $(BIN1).c R1OBJS1 = $(R1SRCS1:.c=.o) @@ -162,6 +161,20 @@ $(BIN3): $(BIN3).r2 # @echo "LD: $<" # $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN1): $(BIN1) + $(Q) install -D $(BIN1) $(ROMFS_DIR)/$(BIN1) + +$(ROMFS_DIR)/$(BIN2): $(BIN2) + $(Q) install -D $(BIN2) $(ROMFS_DIR)/$(BIN2) + +$(ROMFS_DIR)/$(BIN3): $(BIN3) + $(Q) install -D $(BIN3) $(ROMFS_DIR)/$(BIN3) + +#$(ROMFS_DIR)/$(BIN4): $(BIN4) +# $(Q) install -D $(BIN4) $(ROMFS_DIR)/$(BIN4) + +install: $(ROMFS_DIR)/$(BIN1) $(ROMFS_DIR)/$(BIN2) $(ROMFS_DIR)/$(BIN3) + clean: $(call DELFILE, $(BIN1)) $(call DELFILE, $(BIN2)) @@ -174,9 +187,3 @@ clean: $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: $(ALL_BIN) - $(Q) install -D $(BIN1) $(ROMFS_DIR)/$(BIN1) - $(Q) install -D $(BIN2) $(ROMFS_DIR)/$(BIN2) - $(Q) install -D $(BIN3) $(ROMFS_DIR)/$(BIN3) -# $(Q) install -D $(BIN4) $(ROMFS_DIR)/$(BIN4) diff --git a/examples/nxflat/tests/hello/Makefile b/examples/nxflat/tests/hello/Makefile index 040e37752..eb60dd60c 100644 --- a/examples/nxflat/tests/hello/Makefile +++ b/examples/nxflat/tests/hello/Makefile @@ -69,12 +69,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/nxflat/tests/longjmp/Makefile b/examples/nxflat/tests/longjmp/Makefile index 0e48afab9..8a9846789 100644 --- a/examples/nxflat/tests/longjmp/Makefile +++ b/examples/nxflat/tests/longjmp/Makefile @@ -69,12 +69,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/nxflat/tests/mutex/Makefile b/examples/nxflat/tests/mutex/Makefile index 855aca59f..b53a4994f 100644 --- a/examples/nxflat/tests/mutex/Makefile +++ b/examples/nxflat/tests/mutex/Makefile @@ -69,12 +69,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/nxflat/tests/pthread/Makefile b/examples/nxflat/tests/pthread/Makefile index 38432f4a9..164941014 100644 --- a/examples/nxflat/tests/pthread/Makefile +++ b/examples/nxflat/tests/pthread/Makefile @@ -69,12 +69,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/nxflat/tests/signal/Makefile b/examples/nxflat/tests/signal/Makefile index 5b08e9912..2211747f5 100644 --- a/examples/nxflat/tests/signal/Makefile +++ b/examples/nxflat/tests/signal/Makefile @@ -69,12 +69,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/nxflat/tests/struct/Makefile b/examples/nxflat/tests/struct/Makefile index 94f107785..77cd7e7c4 100644 --- a/examples/nxflat/tests/struct/Makefile +++ b/examples/nxflat/tests/struct/Makefile @@ -71,12 +71,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/nxflat/tests/task/Makefile b/examples/nxflat/tests/task/Makefile index 177bc7537..e532be44e 100644 --- a/examples/nxflat/tests/task/Makefile +++ b/examples/nxflat/tests/task/Makefile @@ -69,12 +69,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/posix_spawn/filesystem/hello/Makefile b/examples/posix_spawn/filesystem/hello/Makefile index 3c9d0fca6..fc316fcbc 100644 --- a/examples/posix_spawn/filesystem/hello/Makefile +++ b/examples/posix_spawn/filesystem/hello/Makefile @@ -51,11 +51,13 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(ROMFS_DIR) + $(Q) install $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, *.dSYM) $(call CLEAN) - -install: $(BIN) - $(Q) mkdir -p $(ROMFS_DIR) - $(Q) install $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/posix_spawn/filesystem/redirect/Makefile b/examples/posix_spawn/filesystem/redirect/Makefile index 9b30d4b44..47b543dc5 100644 --- a/examples/posix_spawn/filesystem/redirect/Makefile +++ b/examples/posix_spawn/filesystem/redirect/Makefile @@ -51,11 +51,13 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDELFFLAGS) -o $@ $^ +$(ROMFS_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(ROMFS_DIR) + $(Q) install -m 0755 $(BIN) $(ROMFS_DIR)/$(BIN) + +install: $(ROMFS_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, *.dSYM) $(call CLEAN) - -install: $(BIN) - $(Q) mkdir -p $(ROMFS_DIR) - $(Q) install -m 0755 $(BIN) $(ROMFS_DIR)/$(BIN) diff --git a/examples/sotest/lib/modprint/Makefile b/examples/sotest/lib/modprint/Makefile index 3c779866d..96e230e23 100644 --- a/examples/sotest/lib/modprint/Makefile +++ b/examples/sotest/lib/modprint/Makefile @@ -88,10 +88,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDMODULEFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSROOT_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSROOT_DIR) + $(Q) install $(BIN) $(FSROOT_DIR)/$(BIN) + +install: $(FSROOT_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSROOT_DIR) - $(Q) install $(BIN) $(FSROOT_DIR)/$(BIN) diff --git a/examples/sotest/lib/sotest/Makefile b/examples/sotest/lib/sotest/Makefile index 45c9ac6ff..c0ac2e494 100644 --- a/examples/sotest/lib/sotest/Makefile +++ b/examples/sotest/lib/sotest/Makefile @@ -88,10 +88,12 @@ $(BIN): $(OBJS) @echo "LD: $<" $(Q) $(LD) $(LDMODULEFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(FSROOT_DIR)/$(BIN): $(BIN) + $(Q) mkdir -p $(FSROOT_DIR) + $(Q) install $(BIN) $(FSROOT_DIR)/$(BIN) + +install: $(FSROOT_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call CLEAN) - -install: - $(Q) mkdir -p $(FSROOT_DIR) - $(Q) install $(BIN) $(FSROOT_DIR)/$(BIN) diff --git a/examples/thttpd/content/hello/Makefile b/examples/thttpd/content/hello/Makefile index 226cbd0b9..dcdcb991e 100644 --- a/examples/thttpd/content/hello/Makefile +++ b/examples/thttpd/content/hello/Makefile @@ -70,12 +70,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(CGI_DIR)/$(BIN): $(BIN) + $(Q) install -m 0755 -D $(BIN) $(CGI_DIR)/$(BIN) + +install: $(CGI_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -m 0755 -D $(BIN) $(CGI_DIR)/$(BIN) diff --git a/examples/thttpd/content/tasks/Makefile b/examples/thttpd/content/tasks/Makefile index de3d576ca..f0304fc93 100644 --- a/examples/thttpd/content/tasks/Makefile +++ b/examples/thttpd/content/tasks/Makefile @@ -73,12 +73,14 @@ $(BIN): $(BIN).r2 @echo "LD: $<" $(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ +$(CGI_DIR)/$(BIN): $(BIN) + $(Q) install -m 0755 -D $(BIN) $(CGI_DIR)/$(BIN) + +install: $(CGI_DIR)/$(BIN) + clean: $(call DELFILE, $(BIN)) $(call DELFILE, $(R2SRC)) $(call DELFILE, *.r1) $(call DELFILE, *.r2) $(call CLEAN) - -install: - $(Q) install -m 0755 -D $(BIN) $(CGI_DIR)/$(BIN) diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh index 1cc616a01..f8414d60f 100755 --- a/tools/mksymtab.sh +++ b/tools/mksymtab.sh @@ -48,13 +48,6 @@ if [ -z "$dir" ]; then exit 1 fi -if [ ! -d "$dir" ]; then - echo "ERROR: Directory $dir does not exist" - echo "" - echo $usage - exit 1 -fi - # Get the output file name outfile=$2