From 0da11876b0390cd4fe96d365414f68f24ca5ce9c Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 24 Mar 2011 00:28:50 +0000 Subject: [PATCH] apps/ initialization now occurs during the earlier context build phase git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3412 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 15 ++++++++++----- Makefile | 15 ++++++++++++--- README.txt | 6 ++++-- examples/Makefile | 4 +++- examples/dhcpd/Makefile | 2 +- examples/hello/Makefile | 2 +- examples/helloxx/Makefile | 2 +- examples/hidkbd/Makefile | 2 +- examples/igmp/Makefile | 2 +- examples/mm/Makefile | 2 +- examples/mount/Makefile | 2 +- examples/nsh/Makefile | 2 +- examples/null/Makefile | 2 +- examples/nx/Makefile | 2 +- examples/nxflat/Makefile | 2 +- examples/ostest/Makefile | 2 +- examples/pashello/Makefile | 2 +- examples/pipe/Makefile | 2 +- examples/poll/Makefile | 2 +- examples/romfs/Makefile | 2 +- examples/sendmail/Makefile | 2 +- examples/serloop/Makefile | 2 +- examples/thttpd/Makefile | 2 +- examples/uip/Makefile | 2 +- examples/usbserial/Makefile | 2 +- examples/usbstorage/Makefile | 2 +- examples/wget/Makefile | 2 +- examples/wlan/Makefile | 2 +- netutils/Makefile | 4 +++- nshlib/Makefile | 8 +++++--- nuttapp/Makefile | 13 +++++++++---- vsn/Makefile | 10 +++++++++- vsn/free/Makefile | 18 +++++++++++++----- vsn/hello/Makefile | 18 +++++++++++++----- vsn/poweroff/Makefile | 18 +++++++++++++----- vsn/ramtron/Makefile | 18 +++++++++++++----- vsn/sdcard/Makefile | 18 +++++++++++++----- 37 files changed, 144 insertions(+), 69 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 681802a56..8e3733a95 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,14 +3,19 @@ * Initial version of the apps/ directory was released as contributed by Uros Platise. -5.20 2011-xx-xx Gregory Nutt +6.0 2011-03-21 Gregory Nutt * README.txt -- README cosmetics * hello/ -- hello world minor changes * Makefile -- Makefile cosmetics (I am slowly adding the Darjeeling JVM) * Make.defs -- New file adds common make definitions for applications. * hello/Makefile -- Now uses new Make.defs definitions. Added README.txt. - * apps/poweroff -- New application to turn off board power. - * Moved NSH library, netutils, and examples from the nuttx/ directory to - the apps/ directory - * Moved exec_nuttapp machinery into the nuttapp/ directory. + * apps/poweroff -- New application to turn off board power. + * Moved NSH library, netutils, and examples from the nuttx/ directory to + the apps/ directory + * Moved exec_nuttapp machinery into the nuttapp/ directory. + +6.0 2011-xx-xx Gregory Nutt + + * Creation of auto-generated header files now occurs during the context + build phase. diff --git a/Makefile b/Makefile index 5c4e8dc09..2735759c9 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ BIN = libapps$(LIBEXT) # Build targets all: $(BIN) -.PHONY: $(BUILTIN_APPS_BUILT) .depend depend clean distclean +.PHONY: $(BUILTIN_APPS_BUILT) context depend clean distclean $(BUILTIN_APPS_BUILT): @for dir in $(BUILTIN_APPS_DIR) ; do \ @@ -103,7 +103,16 @@ $(BIN): $(BUILTIN_APPS_BUILT) $(call ARCHIVE, $@, $${obj}); \ done ; ) -.depend: Makefile $(SRCS) +.context: + @for dir in $(BUILTIN_APPS_DIR) ; do \ + rm -f $$dir/.context ; \ + $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR) context ; \ + done + @touch $@ + +context: .context + +.depend: context Makefile $(SRCS) @for dir in $(BUILTIN_APPS_DIR) ; do \ rm -f $$dir/.depend ; \ $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR) depend ; \ @@ -123,5 +132,5 @@ distclean: clean @for dir in $(SUBDIRS) ; do \ $(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \ done - @rm -f .config .depend + @rm -f .config .context .depend diff --git a/README.txt b/README.txt index b80393a03..7185d1371 100644 --- a/README.txt +++ b/README.txt @@ -9,7 +9,9 @@ in two files: - exec_nuttapp_proto.h Entry points, prototype function - exec_nuttapp_list.h Application specific information and requirements -Information is collected during the make .depend process. +The build occurs in several phases as different build targets are executed: +(1) contex, (2) depend, and (3) default (all). Application information is +collected during the make context build phase. To execute an application function: @@ -34,7 +36,7 @@ CONFIGURED_APPS list like: CONFIGURED_APPS += hello/.built_always poweroff/.built_always jvm/.built_always -The form of each entry is / when: +The form of each entry is = when: is the name of a subdirectory in the apps directory, and diff --git a/examples/Makefile b/examples/Makefile index 21c11a783..b20442d62 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -42,10 +42,12 @@ SUBDIRS = dhcpd hello helloxx hidkbd igmp mm mount nettest nsh null nx \ udp uip usbserial usbstorage wget wlan all: nothing -.PHONY: nothing depend clean distclean +.PHONY: nothing context depend clean distclean nothing: +context: + depend: @for dir in $(SUBDIRS) ; do \ $(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \ diff --git a/examples/dhcpd/Makefile b/examples/dhcpd/Makefile index d4f03f74b..783418c66 100644 --- a/examples/dhcpd/Makefile +++ b/examples/dhcpd/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/hello/Makefile b/examples/hello/Makefile index c856f145f..11046dbeb 100644 --- a/examples/hello/Makefile +++ b/examples/hello/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/helloxx/Makefile b/examples/helloxx/Makefile index 5cbf55ef3..e4f58a4ea 100755 --- a/examples/helloxx/Makefile +++ b/examples/helloxx/Makefile @@ -87,7 +87,7 @@ $(BIN): chkcxx $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/hidkbd/Makefile b/examples/hidkbd/Makefile index 48b0c90a2..9ea170b8e 100644 --- a/examples/hidkbd/Makefile +++ b/examples/hidkbd/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/igmp/Makefile b/examples/igmp/Makefile index d1362f0b8..947b95484 100755 --- a/examples/igmp/Makefile +++ b/examples/igmp/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/mm/Makefile b/examples/mm/Makefile index 747a1a1e2..30cfea32f 100644 --- a/examples/mm/Makefile +++ b/examples/mm/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/mount/Makefile b/examples/mount/Makefile index 04d2d21f6..3cfc2f35c 100644 --- a/examples/mount/Makefile +++ b/examples/mount/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/nsh/Makefile b/examples/nsh/Makefile index 1887d3bbe..d6d78bc00 100644 --- a/examples/nsh/Makefile +++ b/examples/nsh/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/null/Makefile b/examples/null/Makefile index 9d842638a..472b06289 100644 --- a/examples/null/Makefile +++ b/examples/null/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/nx/Makefile b/examples/nx/Makefile index 72ba1915f..1f543a34e 100644 --- a/examples/nx/Makefile +++ b/examples/nx/Makefile @@ -73,7 +73,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/nxflat/Makefile b/examples/nxflat/Makefile index 73a5a95d1..570a059a8 100644 --- a/examples/nxflat/Makefile +++ b/examples/nxflat/Makefile @@ -73,7 +73,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) # We can't make dependencies in this directory because the required diff --git a/examples/ostest/Makefile b/examples/ostest/Makefile index 469fe032a..3c0284d73 100644 --- a/examples/ostest/Makefile +++ b/examples/ostest/Makefile @@ -110,7 +110,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/pashello/Makefile b/examples/pashello/Makefile index 6e2579191..11d99ce56 100644 --- a/examples/pashello/Makefile +++ b/examples/pashello/Makefile @@ -77,7 +77,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/pipe/Makefile b/examples/pipe/Makefile index e46bbdd82..0f56c5553 100644 --- a/examples/pipe/Makefile +++ b/examples/pipe/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/poll/Makefile b/examples/poll/Makefile index e33e493f1..0a0e0e65d 100644 --- a/examples/poll/Makefile +++ b/examples/poll/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/romfs/Makefile b/examples/romfs/Makefile index 7e12866f8..764f70640 100644 --- a/examples/romfs/Makefile +++ b/examples/romfs/Makefile @@ -86,7 +86,7 @@ $(BIN): romfs_testdir.h $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/sendmail/Makefile b/examples/sendmail/Makefile index 81aed5ca6..a3beb7059 100644 --- a/examples/sendmail/Makefile +++ b/examples/sendmail/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/serloop/Makefile b/examples/serloop/Makefile index c3c0274db..0366d6248 100644 --- a/examples/serloop/Makefile +++ b/examples/serloop/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/thttpd/Makefile b/examples/thttpd/Makefile index 91c8c19e1..2690e6297 100644 --- a/examples/thttpd/Makefile +++ b/examples/thttpd/Makefile @@ -73,7 +73,7 @@ $(BIN): headers $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/uip/Makefile b/examples/uip/Makefile index 08abe15b0..59c5f76b4 100644 --- a/examples/uip/Makefile +++ b/examples/uip/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/usbserial/Makefile b/examples/usbserial/Makefile index 2ac0cb085..b4d51ab82 100644 --- a/examples/usbserial/Makefile +++ b/examples/usbserial/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/usbstorage/Makefile b/examples/usbstorage/Makefile index 5e8983f46..aa3512547 100644 --- a/examples/usbstorage/Makefile +++ b/examples/usbstorage/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/wget/Makefile b/examples/wget/Makefile index b9cc15510..f245bf5a4 100644 --- a/examples/wget/Makefile +++ b/examples/wget/Makefile @@ -70,7 +70,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/examples/wlan/Makefile b/examples/wlan/Makefile index 756389571..313436815 100755 --- a/examples/wlan/Makefile +++ b/examples/wlan/Makefile @@ -71,7 +71,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $${obj}); \ done ; ) @touch .built - + .built: $(BIN) .depend: Makefile $(SRCS) diff --git a/netutils/Makefile b/netutils/Makefile index cf33cf0f9..d0268698f 100644 --- a/netutils/Makefile +++ b/netutils/Makefile @@ -42,10 +42,12 @@ SUBDIRS = uiplib dhcpc dhcpd resolv smtp telnetd webclient webserver tftpc thttp endif all: nothing -.PHONY: nothing depend clean distclean +.PHONY: nothing context depend clean distclean nothing: +context: + depend: @for dir in $(SUBDIRS) ; do \ $(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \ diff --git a/nshlib/Makefile b/nshlib/Makefile index ecd2e5576..7074cd0cc 100644 --- a/nshlib/Makefile +++ b/nshlib/Makefile @@ -76,12 +76,12 @@ OBJS = $(AOBJS) $(COBJS) BIN = $(APPDIR)/libapps$(LIBEXT) ROOTDEPPATH = --dep-path . - -# Common build - VPATH = +# Build targets + all: .built +.PHONY: context .depend depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -97,6 +97,8 @@ $(BIN): $(OBJS) .built: $(BIN) +context: + .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) \ $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/nuttapp/Makefile b/nuttapp/Makefile index 092236027..9cdb4ff5d 100644 --- a/nuttapp/Makefile +++ b/nuttapp/Makefile @@ -58,7 +58,7 @@ VPATH = # Build Targets all: .built -.PHONY: depend .depend clean distclean +.PHONY: .context context .depend depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -74,9 +74,14 @@ $(BIN): $(OBJS) .built: $(BIN) +.context: + @echo "/* List of application requirements, generated during make context. */" > exec_nuttapp_list.h + @echo "/* List of application entry points, generated during make context. */" > exec_nuttapp_proto.h + @touch $@ + +context: .context + .depend: Makefile $(SRCS) - @echo "/* List of application requirements, generated during make depend. */" > exec_nuttapp_list.h - @echo "/* List of application entry points, generated during make depend. */" > exec_nuttapp_proto.h @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep @touch $@ @@ -87,7 +92,7 @@ clean: $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + @rm -f .context Make.dep .depend @rm -f exec_nuttapp_list.h @rm -f exec_nuttapp_proto.h diff --git a/vsn/Makefile b/vsn/Makefile index b3fed59c2..a2dab4dbc 100644 --- a/vsn/Makefile +++ b/vsn/Makefile @@ -40,10 +40,18 @@ SUBDIRS = free hello poweroff ramtron sdcard all: nothing -.PHONY: nothing depend clean distclean +.PHONY: nothing context depend clean distclean nothing: +.context: + @for dir in $(SUBDIRS) ; do \ + $(MAKE) -C $$dir context TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \ + done + @touch $@ + +context: .context + depend: @for dir in $(SUBDIRS) ; do \ $(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \ diff --git a/vsn/free/Makefile b/vsn/free/Makefile index 01545d06d..cac2b1d10 100644 --- a/vsn/free/Makefile +++ b/vsn/free/Makefile @@ -70,6 +70,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built +.PHONY: .built context depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -85,13 +86,20 @@ $(BIN): $(OBJS) .built: $(BIN) -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep +# Register application + +.context: $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) @touch $@ -# Register application +context: .context + +# Create dependencies + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + depend: .depend clean: @@ -99,6 +107,6 @@ clean: $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + @rm -f .context Make.dep .depend -include Make.dep diff --git a/vsn/hello/Makefile b/vsn/hello/Makefile index 45f60e9bd..23aba200c 100644 --- a/vsn/hello/Makefile +++ b/vsn/hello/Makefile @@ -70,6 +70,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built +.PHONY: .built context depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -85,13 +86,20 @@ $(BIN): $(OBJS) .built: $(BIN) -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep +# Register application + +.context: $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) @touch $@ -# Register application +context: .context + +# Create dependencies + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + depend: .depend clean: @@ -99,6 +107,6 @@ clean: $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + @rm -f .context Make.dep .depend -include Make.dep diff --git a/vsn/poweroff/Makefile b/vsn/poweroff/Makefile index d4fc2ed00..5337fd45b 100644 --- a/vsn/poweroff/Makefile +++ b/vsn/poweroff/Makefile @@ -70,6 +70,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built +.PHONY: .built context depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -85,13 +86,20 @@ $(BIN): $(OBJS) .built: $(BIN) -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep +# Register application + +.context: $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) @touch $@ -# Register application +context: .context + +# Create dependencies + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + depend: .depend clean: @@ -99,6 +107,6 @@ clean: $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + @rm -f .context Make.dep .depend -include Make.dep diff --git a/vsn/ramtron/Makefile b/vsn/ramtron/Makefile index c9aeae651..440af1ceb 100644 --- a/vsn/ramtron/Makefile +++ b/vsn/ramtron/Makefile @@ -70,6 +70,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built +.PHONY: .built context depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -85,13 +86,20 @@ $(BIN): $(OBJS) .built: $(BIN) -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep +# Register application + +.context: $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) @touch $@ -# Register application +context: .context + +# Create dependencies + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + depend: .depend clean: @@ -99,6 +107,6 @@ clean: $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + @rm -f .context Make.dep .depend -include Make.dep diff --git a/vsn/sdcard/Makefile b/vsn/sdcard/Makefile index ea0f51f35..3a7454140 100644 --- a/vsn/sdcard/Makefile +++ b/vsn/sdcard/Makefile @@ -70,6 +70,7 @@ ROOTDEPPATH = --dep-path . VPATH = all: .built +.PHONY: .built context depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -85,13 +86,20 @@ $(BIN): $(OBJS) .built: $(BIN) -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep +# Register application + +.context: $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) @touch $@ -# Register application +context: .context + +# Create dependencies + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + depend: .depend clean: @@ -99,6 +107,6 @@ clean: $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + @rm -f .context Make.dep .depend -include Make.dep