diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-17 18:54:53 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-17 18:54:53 +0000 |
commit | d4dca58d933cf2c713ee8ccead6fce329e199320 (patch) | |
tree | d220ebef3bfba64591298b4c51a0c0dd6e10ae0b /nuttx | |
parent | cc099195b8a4baa726810a7811e341f383d442eb (diff) | |
download | px4-firmware-d4dca58d933cf2c713ee8ccead6fce329e199320.tar.gz px4-firmware-d4dca58d933cf2c713ee8ccead6fce329e199320.tar.bz2 px4-firmware-d4dca58d933cf2c713ee8ccead6fce329e199320.zip |
Most of the changes needed to support Windows native clean; distclean is has a problem
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5367 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
31 files changed, 227 insertions, 140 deletions
diff --git a/nuttx/Makefile.unix b/nuttx/Makefile.unix index 439aa2d4b..3b641e8b2 100644 --- a/nuttx/Makefile.unix +++ b/nuttx/Makefile.unix @@ -419,10 +419,10 @@ context: check_context include/nuttx/config.h include/nuttx/version.h include/ma # and symbolic links created by the context target. clean_context: - $(Q) rm -f include/nuttx/config.h - $(Q) rm -f include/nuttx/version.h - $(Q) rm -f include/math.h - $(Q) rm -f include/stdarg.h + $(call DELFILE include/nuttx/config.h) + $(call DELFILE include/nuttx/version.h) + $(call DELFILE include/math.h) + $(call DELFILE include/stdarg.h) $(Q) $(DIRUNLINK) include/arch/board $(Q) $(DIRUNLINK) include/arch/chip $(Q) $(DIRUNLINK) include/arch @@ -686,8 +686,13 @@ ifeq ($(CONFIG_BUILD_2PASS),y) endif clean: subdir_clean - $(Q) rm -f $(BIN) nuttx.* mm_test *.map _SAVED_APPS_config *~ - $(Q) rm -f nuttx-export* + $(call DELFILE $(BIN)) + $(call DELFILE nuttx.*) + $(call DELFILE mm_test) + $(call DELFILE *.map) + $(call DELFILE _SAVED_APPS_config) + $(call DELFILE nuttx-export*) + $(call CLEAN) subdir_distclean: $(Q) for dir in $(CLEANDIRS) ; do \ @@ -700,7 +705,11 @@ distclean: clean subdir_distclean clean_context ifeq ($(CONFIG_BUILD_2PASS),y) $(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.defs setenv.sh setenv.bat .config .config.old + $(call DELFILE Make.defs) + $(call DELFILE setenv.sh) + $(call DELFILE setenv.bat) + $(call DELFILE .config) + $(call DELFILE .config.old) # Application housekeeping targets. The APPDIR variable refers to the user # application directory. A sample apps/ directory is included with NuttX, diff --git a/nuttx/Makefile.win b/nuttx/Makefile.win index f43f14f0d..f98c5e6d8 100644 --- a/nuttx/Makefile.win +++ b/nuttx/Makefile.win @@ -438,10 +438,10 @@ context: check_context include\nuttx\config.h include\nuttx\version.h include\ma # and symbolic links created by the context target. clean_context: - $(Q) rm -f include\nuttx\config.h - $(Q) rm -f include\nuttx\version.h - $(Q) rm -f include\math.h - $(Q) rm -f include\stdarg.h + $(call DELFILE include\nuttx\config.h) + $(call DELFILE include\nuttx\version.h) + $(call DELFILE include\math.h) + $(call DELFILE include\stdarg.h) $(Q) $(DIRUNLINK) include\arch\board $(Q) $(DIRUNLINK) include\arch\chip $(Q) $(DIRUNLINK) include\arch @@ -688,8 +688,13 @@ ifeq ($(CONFIG_BUILD_2PASS),y) endif clean: subdir_clean - $(Q) rm -f $(BIN) nuttx.* mm_test *.map _SAVED_APPS_config *~ - $(Q) rm -f nuttx-export* + $(call DELFILE $(BIN)) + $(call DELFILE nuttx.*) + $(call DELFILE mm_test) + $(call DELFILE *.map) + $(call DELFILE _SAVED_APPS_config) + $(call DELFILE nuttx-export*) + $(call CLEAN) subdir_distclean: $(Q) for %%G in ($(CLEANDIRS)) do ( if exist %%G\Makefile $(MAKE) -C %%G TOPDIR="$(TOPDIR)" distclean ) @@ -698,7 +703,11 @@ distclean: clean subdir_distclean clean_context ifeq ($(CONFIG_BUILD_2PASS),y) $(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.defs setenv.sh setenv.bat .config .config.old + $(call DELFILE Make.defs) + $(call DELFILE setenv.sh) + $(call DELFILE setenv.bat) + $(call DELFILE .config) + $(call DELFILE .config.old) # Application housekeeping targets. The APPDIR variable refers to the user # application directory. A sample apps\ directory is included with NuttX, @@ -723,16 +732,9 @@ endif apps_distclean: ifneq ($(APPDIR),) - $(Q) if [ -r "$(TOPDIR)\$(APPDIR)\.config" ]; then \ - cp "$(TOPDIR)\$(APPDIR)\.config" _SAVED_APPS_config || \ - { echo "Copy of $(APPDIR)\.config failed" ; exit 1 ; } \ - else \ - rm -f _SAVED_APPS_config; \ - fi + $(call DELFILE _SAVED_APPS_config + $(Q) if exist "$(TOPDIR)\$(APPDIR)\.config" ( cp "$(TOPDIR)\$(APPDIR)\.config" _SAVED_APPS_config ) $(Q) $(MAKE) -C "$(TOPDIR)\$(APPDIR)" TOPDIR="$(TOPDIR)" distclean - $(Q) if [ -r _SAVED_APPS_config ]; then \ - mv _SAVED_APPS_config "$(TOPDIR)\$(APPDIR)\.config" || \ - { echo "Copy of _SAVED_APPS_config failed" ; exit 1 ; } \ - fi + $(Q) if exist _SAVED_APPS_config ( mv _SAVED_APPS_config "$(TOPDIR)\$(APPDIR)\.config" ) endif diff --git a/nuttx/arch/8051/src/Makefile b/nuttx/arch/8051/src/Makefile index 4772834d9..6c87b8bc9 100644 --- a/nuttx/arch/8051/src/Makefile +++ b/nuttx/arch/8051/src/Makefile @@ -221,13 +221,15 @@ clean: $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ fi - $(Q) rm -f libarch$(LIBEXT) up_mem.h *~ .*.swp + $(call DELFILE libarch$(LIBEXT)) + $(call DELFILE up_mem.h) $(call CLEAN) distclean: clean $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \ fi - rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile index a48d18799..a6d5fa4f4 100644 --- a/nuttx/arch/arm/src/Makefile +++ b/nuttx/arch/arm/src/Makefile @@ -178,13 +178,14 @@ clean: ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/avr/src/Makefile b/nuttx/arch/avr/src/Makefile index 462968ed5..69d3a0fc0 100644 --- a/nuttx/arch/avr/src/Makefile +++ b/nuttx/arch/avr/src/Makefile @@ -171,14 +171,15 @@ clean: ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/hc/src/Makefile b/nuttx/arch/hc/src/Makefile index 0ada6c4c2..7353b44ea 100644 --- a/nuttx/arch/hc/src/Makefile +++ b/nuttx/arch/hc/src/Makefile @@ -166,13 +166,14 @@ clean: ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/mips/src/Makefile b/nuttx/arch/mips/src/Makefile index 057b95d22..b27fe8730 100644 --- a/nuttx/arch/mips/src/Makefile +++ b/nuttx/arch/mips/src/Makefile @@ -164,13 +164,14 @@ clean: ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/rgmp/src/Makefile b/nuttx/arch/rgmp/src/Makefile index 7650a0a94..019dca465 100644 --- a/nuttx/arch/rgmp/src/Makefile +++ b/nuttx/arch/rgmp/src/Makefile @@ -96,12 +96,14 @@ export_head: depend: .depend clean: - @rm -f $(TOPDIR)/arch/rgmp/src/x86/*.o - @rm -f $(TOPDIR)/kernel.img nuttx.img - @rm -f libarch$(LIBEXT) *~ .*.swp + $(call DELFILE "$(TOPDIR)/arch/rgmp/src/x86/*.o") + $(call DELFILE "$(TOPDIR)/kernel.img") + $(call DELFILE nuttx.img) + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/sh/src/Makefile b/nuttx/arch/sh/src/Makefile index 132ca4610..af7c481a9 100644 --- a/nuttx/arch/sh/src/Makefile +++ b/nuttx/arch/sh/src/Makefile @@ -161,13 +161,14 @@ clean: ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile index a5d6100a3..5abd6ce4f 100644 --- a/nuttx/arch/sim/src/Makefile +++ b/nuttx/arch/sim/src/Makefile @@ -214,14 +214,16 @@ clean: cleanrel $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - $(Q) rm -f nuttx.rel libarch$(LIBEXT) *~ .*.swp + $(call DELFILE nuttx.rel) + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) $(Q) rm -rf GNU -include Make.dep diff --git a/nuttx/arch/x86/src/Makefile b/nuttx/arch/x86/src/Makefile index 19193709c..e93dc2657 100644 --- a/nuttx/arch/x86/src/Makefile +++ b/nuttx/arch/x86/src/Makefile @@ -172,13 +172,14 @@ clean: ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean endif - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/z16/src/Makefile b/nuttx/arch/z16/src/Makefile index 44f96d03d..d3f581998 100644 --- a/nuttx/arch/z16/src/Makefile +++ b/nuttx/arch/z16/src/Makefile @@ -137,16 +137,20 @@ clean: $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp ifeq ($(COMPILER),zneocc.exe) - $(Q) rm -f nuttx.linkcmd *.asm *.tmp *.map + $(call DELFILE nuttx.linkcmd) + $(call DELFILE *.asm) + $(call DELFILE *.tmp) + $(call DELFILE *.map) endif + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/z80/src/Makefile.sdcc b/nuttx/arch/z80/src/Makefile.sdcc index 7c9f45a6c..e29fa9fda 100644 --- a/nuttx/arch/z80/src/Makefile.sdcc +++ b/nuttx/arch/z80/src/Makefile.sdcc @@ -240,13 +240,19 @@ clean: $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - $(Q) rm -f libarch$(LIBEXT) up_mem.h asm_mem.h pass1.* nuttx.* *~ .*.swp + $(call DELFILE up_mem.h) + $(call DELFILE asm_mem.h) + $(call DELFILE pass1.*) + $(call DELFILE nuttx.*) + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) + distclean: clean $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/arch/z80/src/Makefile.zdsii b/nuttx/arch/z80/src/Makefile.zdsii index 666af8945..1d7b1f96d 100644 --- a/nuttx/arch/z80/src/Makefile.zdsii +++ b/nuttx/arch/z80/src/Makefile.zdsii @@ -150,14 +150,18 @@ clean: $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - $(Q) rm -f libarch$(LIBEXT) *~ .*.swp - $(Q) rm -f nuttx.linkcmd *.asm *.tmp *.map + $(call DELFILE nuttx.linkcmd) + $(call DELFILE *.asm) + $(call DELFILE *.tmp) + $(call DELFILE *.map) + $(call DELFILE libarch$(LIBEXT)) $(call CLEAN) distclean: clean $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/binfmt/Makefile b/nuttx/binfmt/Makefile index 06def551f..f90ea0417 100644 --- a/nuttx/binfmt/Makefile +++ b/nuttx/binfmt/Makefile @@ -87,13 +87,11 @@ $(BIN): $(BINFMT_OBJS) depend: .depend clean: - $(Q) rm -f $(BIN) *~ .*.swp + $(call DELFILE $(BIN)) $(call CLEAN) - $(Q) ( for dir in $(SUBDIRS); do \ - rm -f $${dir}/*~ $${dir}/.*.swp; \ - done ; ) distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/configs/stm32f4discovery/src/Makefile b/nuttx/configs/stm32f4discovery/src/Makefile index b6d0f6226..f4d5a89d9 100644 --- a/nuttx/configs/stm32f4discovery/src/Makefile +++ b/nuttx/configs/stm32f4discovery/src/Makefile @@ -126,16 +126,17 @@ libboard$(LIBEXT): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) .depend: Makefile $(SRCS) - @$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f libboard$(LIBEXT) *~ .*.swp + $(call DELFILE libboard$(LIBEXT)) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/drivers/Makefile b/nuttx/drivers/Makefile index 98bb8a7d0..57b2b489a 100644 --- a/nuttx/drivers/Makefile +++ b/nuttx/drivers/Makefile @@ -111,10 +111,11 @@ $(BIN): $(OBJS) depend: .depend clean: - $(Q) rm -f $(BIN) *~ .*.swp + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile index b55ec6218..eb036fed0 100644 --- a/nuttx/fs/Makefile +++ b/nuttx/fs/Makefile @@ -130,13 +130,11 @@ $(BIN): $(OBJS) depend: .depend clean: - $(Q) rm -f $(BIN) *~ .*.swp + $(call DELFILE $(BIN)) $(call CLEAN) - $(Q) ( for dir in $(SUBDIRS); do \ - rm -f $${dir}/*~ $${dir}/.*.swp; \ - done ; ) distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/graphics/Makefile b/nuttx/graphics/Makefile index d0fdb647d..ddcfd21d2 100644 --- a/nuttx/graphics/Makefile +++ b/nuttx/graphics/Makefile @@ -33,7 +33,6 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs DEPPATH = --dep-path . @@ -201,13 +200,14 @@ context: gensources clean: $(Q) $(MAKE) -C nxglib -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) $(Q) $(MAKE) -C nxfonts -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) - $(Q) rm -f $(BIN) *~ .*.swp + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean $(Q) $(MAKE) -C nxglib -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) $(Q) $(MAKE) -C nxfonts -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES) - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/graphics/nxfonts/Makefile.sources b/nuttx/graphics/nxfonts/Makefile.sources index f2aa87caf..eeb47d1b2 100644 --- a/nuttx/graphics/nxfonts/Makefile.sources +++ b/nuttx/graphics/nxfonts/Makefile.sources @@ -33,7 +33,6 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs ifdef NXFONTS_BITSPERPIXEL @@ -177,13 +176,14 @@ all: $(GEN_CSRC) .PHONY : clean distclean $(GEN_CSRC) : $(DEPENDENCY) - @$(call PREPROCESS, $<, $(GEN_TMP)) - @cat $(GEN_TMP) | sed -e "/^#/d" >$@ - @rm -f $(GEN_TMP) + $(call PREPROCESS, $<, $(GEN_TMP)) + $(Q) cat $(GEN_TMP) | sed -e "/^#/d" >$@ + $(Q) rm -f $(GEN_TMP) clean: - @rm -f *~ .*.swp *.i + $(call DELFILE *.i) + $(call CLEAN) distclean: clean - @rm -f nxfonts_convert_*bpp.c - @rm -f nxfonts_bitmaps_*.c + $(call DELFILE nxfonts_convert_*bpp.c) + $(call DELFILE nxfonts_bitmaps_*.c) diff --git a/nuttx/graphics/nxglib/Makefile.sources b/nuttx/graphics/nxglib/Makefile.sources index 67f8defc3..bb94c1b20 100644 --- a/nuttx/graphics/nxglib/Makefile.sources +++ b/nuttx/graphics/nxglib/Makefile.sources @@ -33,7 +33,6 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs ifeq ($(NXGLIB_BITSPERPIXEL),1) @@ -123,53 +122,54 @@ all: $(GEN_CSRCS) $(SETP_CSRC) : $(BLITDIR)/nxglib_setpixel.c nxglib_bitblit.h ifneq ($(NXGLIB_BITSPERPIXEL),) - @$(call PREPROCESS, $(BLITDIR)/nxglib_setpixel.c, $(SETP_TMP)) - @cat $(SETP_TMP) | sed -e "/^#/d" >$@ - @rm -f $(SETP_TMP) + $(call PREPROCESS, $(BLITDIR)/nxglib_setpixel.c, $(SETP_TMP)) + $(Q) cat $(SETP_TMP) | sed -e "/^#/d" >$@ + $(Q) rm -f $(SETP_TMP) endif $(RFILL_CSRC) : $(BLITDIR)/nxglib_fillrectangle.c nxglib_bitblit.h ifneq ($(NXGLIB_BITSPERPIXEL),) - @$(call PREPROCESS, $(BLITDIR)/nxglib_fillrectangle.c, $(RFILL_TMP)) - @cat $(RFILL_TMP) | sed -e "/^#/d" >$@ - @rm -f $(RFILL_TMP) + $(call PREPROCESS, $(BLITDIR)/nxglib_fillrectangle.c, $(RFILL_TMP)) + $(Q) cat $(RFILL_TMP) | sed -e "/^#/d" >$@ + $(Q) rm -f $(RFILL_TMP) endif $(RGET_CSRC) : $(BLITDIR)/nxglib_getrectangle.c nxglib_bitblit.h ifneq ($(NXGLIB_BITSPERPIXEL),) - @$(call PREPROCESS, $(BLITDIR)/nxglib_getrectangle.c, $(RGET_TMP)) - @cat $(RGET_TMP) | sed -e "/^#/d" >$@ - @rm -f $(RGET_TMP) + $(call PREPROCESS, $(BLITDIR)/nxglib_getrectangle.c, $(RGET_TMP)) + $(Q) cat $(RGET_TMP) | sed -e "/^#/d" >$@ + $(Q) rm -f $(RGET_TMP) endif $(TFILL_CSRC) : $(BLITDIR)/nxglib_filltrapezoid.c nxglib_bitblit.h ifneq ($(NXGLIB_BITSPERPIXEL),) - @$(call PREPROCESS, $(BLITDIR)/nxglib_filltrapezoid.c, $(TFILL_TMP)) - @cat $(TFILL_TMP) | sed -e "/^#/d" >$@ - @rm -f $(TFILL_TMP) + $(call PREPROCESS, $(BLITDIR)/nxglib_filltrapezoid.c, $(TFILL_TMP)) + $(Q) cat $(TFILL_TMP) | sed -e "/^#/d" >$@ + $(Q) rm -f $(TFILL_TMP) endif $(RMOVE_CSRC) : $(BLITDIR)/nxglib_moverectangle.c nxglib_bitblit.h ifneq ($(NXGLIB_BITSPERPIXEL),) - @$(call PREPROCESS, $(BLITDIR)/nxglib_moverectangle.c, $(RMOVE_TMP)) - @cat $(RMOVE_TMP) | sed -e "/^#/d" >$@ - @rm -f $(RMOVE_TMP) + $(call PREPROCESS, $(BLITDIR)/nxglib_moverectangle.c, $(RMOVE_TMP)) + $(Q) cat $(RMOVE_TMP) | sed -e "/^#/d" >$@ + $(Q) rm -f $(RMOVE_TMP) endif $(RCOPY_CSRC) : $(BLITDIR)/nxglib_copyrectangle.c nxglib_bitblit.h ifneq ($(NXGLIB_BITSPERPIXEL),) - @$(call PREPROCESS, $(BLITDIR)/nxglib_copyrectangle.c, $(RCOPY_TMP)) - @cat $(RCOPY_TMP) | sed -e "/^#/d" >$@ - @rm -f $(RCOPY_TMP) + $(call PREPROCESS, $(BLITDIR)/nxglib_copyrectangle.c, $(RCOPY_TMP)) + $(Q) cat $(RCOPY_TMP) | sed -e "/^#/d" >$@ + $(Q) rm -f $(RCOPY_TMP) endif clean: - @rm -f *~ .*.swp *.i + $(call DELFILE *.i) + $(call CLEAN) distclean: clean - @rm -f nxglib_setpixel_*bpp.c - @rm -f nxglib_fillrectangle_*bpp.c - @rm -f nxglib_getrectangle_*bpp.c - @rm -f nxglib_filltrapezoid_*bpp.c - @rm -f nxglib_moverectangle_*bpp.c - @rm -f nxglib_copyrectangle_*bpp.c + $(call DELFILE nxglib_setpixel_*bpp.c) + $(call DELFILE nxglib_fillrectangle_*bpp.c) + $(call DELFILE nxglib_getrectangle_*bpp.c) + $(call DELFILE nxglib_filltrapezoid_*bpp.c) + $(call DELFILE nxglib_moverectangle_*bpp.c) + $(call DELFILE nxglib_copyrectangle_*bpp.c) diff --git a/nuttx/lib/Makefile b/nuttx/lib/Makefile index dca8ea035..58857dbd4 100644 --- a/nuttx/lib/Makefile +++ b/nuttx/lib/Makefile @@ -40,6 +40,6 @@ all: depend: clean: - $(Q) rm -f *$(LIBEXT) + $(call CLEAN) distclean: clean diff --git a/nuttx/libc/Makefile b/nuttx/libc/Makefile index 313629f2b..e7dec4776 100644 --- a/nuttx/libc/Makefile +++ b/nuttx/libc/Makefile @@ -114,7 +114,7 @@ else $(Q) ( if [ -f .userlib ]; then rm -f *$(OBJEXT); fi ) endif endif - $(Q) rm -f .userlib *~ .*.swp + $(call DELFILE .userlib) # Clean kernel-mode temporary files (retaining the KBIN binary) @@ -126,17 +126,20 @@ else $(Q) ( if [ -f .kernlib ]; then rm -f *$(OBJEXT); fi ) endif endif - $(Q) rm -f .kernlib *~ .*.swp + $(call DELFILE .kernlib) # Really clean everything clean: uclean kclean - $(Q) rm -f $(BIN) $(UBIN) $(KBIN) *~ .*.swp + $(call DELFILE $(BIN)) + $(call DELFILE $(UBIN)) + $(call DELFILE $(KBIN)) $(call CLEAN) # Deep clean -- removes all traces of the configuration distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/libxx/Makefile b/nuttx/libxx/Makefile index 6093ad490..cc5578427 100644 --- a/nuttx/libxx/Makefile +++ b/nuttx/libxx/Makefile @@ -105,10 +105,11 @@ $(BIN): $(OBJS) depend: .depend clean: - $(Q) rm -f $(BIN) *~ .*.swp + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/mm/Makefile b/nuttx/mm/Makefile index 8cdfb4d27..b14560ce3 100644 --- a/nuttx/mm/Makefile +++ b/nuttx/mm/Makefile @@ -70,10 +70,11 @@ $(BIN): $(OBJS) depend: .depend clean: - $(Q) rm -f $(BIN) *~ .*.swp + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/mm/Makefile.test b/nuttx/mm/Makefile.test index 63cab910e..e0f1109d8 100644 --- a/nuttx/mm/Makefile.test +++ b/nuttx/mm/Makefile.test @@ -33,12 +33,14 @@ # ############################################################################ -SRCS = mm_test.c mm_initialize.c mm_sem.c mm_addfreechunk.c mm_size2ndx.c mm_shrinkchunk.c \ +-include $(TOPDIR)/Make.defs + +SRCS = mm_test.c mm_initialize.c mm_sem.c mm_addfreechunk.c mm_size2ndx.c mm_shrinkchunk.c \ mm_malloc.c mm_zalloc.c mm_calloc.c mm_realloc.c \ mm_memalign.c mm_free.c mm_mallinfo.c -OBJS = $(SRCS:.c=.o1) +OBJS = $(SRCS:.c=.o1) -LIBS = -lpthread -lc +LIBS = -lpthread -lc CC = gcc LD = gcc @@ -48,17 +50,19 @@ WARNIGNS = -Wall -Wstrict-prototypes -Wshadow CFLAGS = -g $(DEFINES) LDFLAGS = -BIN = ../mm_test +BIN = ..$(DELIM)mm_test all: $(BIN) $(OBJS): %.o1: %.c @echo "Compiling $<" - $(CC) -c $(CFLAGS) $< -o $@ + $(Q) $(CC) -c $(CFLAGS) $< -o $@ $(BIN): $(OBJS) @echo "Linking {$(OBJS)} to produce $@" - $(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ + $(Q) $(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ clean: - @rm -f $(BIN) *.o1 *~ + $(call DELFILE $(BIN)) + $(call DELFILE *.o1) + $(call CLEAN) diff --git a/nuttx/net/Makefile b/nuttx/net/Makefile index aed5734df..29148fafa 100644 --- a/nuttx/net/Makefile +++ b/nuttx/net/Makefile @@ -111,11 +111,11 @@ endif depend: .depend clean: - $(Q) rm -f $(BIN) *~ .*.swp - $(Q) rm -f uip/*~ uip/.*.swp + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile index 601ba5819..ac6489b18 100644 --- a/nuttx/sched/Makefile +++ b/nuttx/sched/Makefile @@ -188,6 +188,7 @@ OBJS = $(AOBJS) $(COBJS) BIN = libsched$(LIBEXT) all: $(BIN) +.PHONY: context depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -205,10 +206,11 @@ $(BIN): $(OBJS) depend: .depend clean: - $(Q) rm -f $(BIN) + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean - $(Q) rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/nuttx/syscall/Makefile b/nuttx/syscall/Makefile index a21eb04ee..15e06e097 100644 --- a/nuttx/syscall/Makefile +++ b/nuttx/syscall/Makefile @@ -34,11 +34,11 @@ ########################################################################### -include $(TOPDIR)/Make.defs -include proxies/Make.defs -include stubs/Make.defs +include proxies$(DELIM)Make.defs +include stubs$(DELIM)Make.defs -MKSYSCALL = "$(TOPDIR)/tools/mksyscall$(EXEEXT)" -CSVFILE = "$(TOPDIR)/syscall/syscall.csv" +MKSYSCALL = "$(TOPDIR)$(DELIM)tools$(DELIM)mksyscall$(EXEEXT)" +CSVFILE = "$(TOPDIR)$(DELIM)syscall$(DELIM)syscall.csv" STUB_SRCS += stub_lookup.c @@ -85,7 +85,7 @@ $(BIN2): $(STUB_OBJS) depend: .depend $(MKSYSCALL): - $(Q) $(MAKE) -C $(TOPDIR)/tools -f Makefile.host mksyscall + $(Q) $(MAKE) -C $(TOPDIR)$(DELIM)tools -f Makefile.host mksyscall .context: syscall.csv $(Q) (cd proxies; $(MKSYSCALL) -p $(CSVFILE);) @@ -95,15 +95,20 @@ $(MKSYSCALL): context: $(MKSYSCALL) .context clean: - $(Q) rm -f $(BIN1) $(BIN2) *~ .*.swp + $(call DELFILE $(BIN1)) + $(call DELFILE $(BIN2)) ifneq ($(OBJEXT),) - $(Q) rm -f proxies/*$(OBJEXT) stubs/*$(OBJEXT) + $(call DELFILE proxies$(DELIM)*$(OBJEXT)) + $(call DELFILE stubs$(DELIM)*$(OBJEXT)) endif $(call CLEAN) distclean: clean - $(Q) rm -f Make.dep .depend .context - $(Q) rm -f proxies/*.c stubs/*.c + $(call DELFILE .context) + $(call DELFILE Make.dep) + $(call DELFILE .depend) + $(call DELFILE proxies$(DELIM)*.c) + $(call DELFILE stubs$(DELIM)*.c) -include Make.dep diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk index 4cdda113c..aafb58f35 100644 --- a/nuttx/tools/Config.mk +++ b/nuttx/tools/Config.mk @@ -2,7 +2,9 @@ # Config.mk # Global build rules and macros. # +# Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Richard Cochran +# Gregory Nutt <gnutt@nuttx.org> # # This file (along with $(TOPDIR)/.config) must be included by every # configuration-specific Make.defs file. @@ -43,6 +45,12 @@ CONFIG_ARCH := $(patsubst "%",%,$(strip $(CONFIG_ARCH))) CONFIG_ARCH_CHIP := $(patsubst "%",%,$(strip $(CONFIG_ARCH_CHIP))) CONFIG_ARCH_BOARD := $(patsubst "%",%,$(strip $(CONFIG_ARCH_BOARD))) +# Some defaults just to prohibit some bad behavior if for some reason they +# are not defined + +OBJEXT ?= .o +LIBEXT ?= .a + # DELIM - Path segment delimiter character # # Depends on this settings defined in board-specific defconfig file installed @@ -167,12 +175,30 @@ define ARCHIVE endef endif +# DELFILE - Delete one file + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define DELFILE + $(Q) if exist $1 (del /f /q $1) +endef +else +define CLEAN + $(Q) rm -f $1 +endef +endif + +# CLEAN - Default clean target + ifeq ($(CONFIG_WINDOWS_NATIVE),y) define CLEAN - $(Q) rm -f *.o *.a + $(Q) if exist *$(OBJEXT) (del /f /q *$(OBJEXT)) + $(Q) if exist *$(LIBEXT) (del /f /q *$(LIBEXT)) + $(Q) if exist *~ (del /f /q *~) + $(Q) if exist (del /f /q .*.swp) endef else define CLEAN - $(Q) rm -f *.o *.a *~ .*.swp + $(Q) rm -f *$(OBJEXT) *$(LIBEXT) *~ .*.swp endef endif +
\ No newline at end of file diff --git a/nuttx/tools/Makefile.host b/nuttx/tools/Makefile.host index 16975a42a..559192c5e 100644 --- a/nuttx/tools/Makefile.host +++ b/nuttx/tools/Makefile.host @@ -122,8 +122,18 @@ mkdeps: mkdeps$(HOSTEXEEXT) endif clean: - $(Q) rm -f *.o *.a *~ .*.swp - $(Q) rm -f mkdeps mkconfig mksyscall mkversion bdf-converter - $(Q) rm -f mkdeps.exe mkconfig.exe mksyscall.exe mkversion.exe bdf-converter.exe + $(call DELFILE mkdeps) + $(call DELFILE mkdeps.exe) + $(call DELFILE mkconfig) + $(call DELFILE mkconfig.exe) + $(call DELFILE Make.dep) + $(call DELFILE mksyscall) + $(call DELFILE mksyscall.exe) + $(call DELFILE mkversion) + $(call DELFILE mkversion.exe) + $(call DELFILE bdf-converter) + $(call DELFILE bdf-converter.exe) +ifneq ($(CONFIG_WINDOWS_NATIVE),y) $(Q) rm -rf *.dSYM - +endif + $(call CLEAN) |