diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 11c134634f..9ae720862c 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -16,7 +16,7 @@
by
Gregory Nutt
-Last Update: January 6, 2006
+Last Update: January 10, 2008
When this makefile fragment runs, it will be passed TOPDIR which diff --git a/Makefile b/Makefile index 43d8d5093d..2d5d2aba5d 100644 --- a/Makefile +++ b/Makefile @@ -217,7 +217,7 @@ subdir_clean: @$(MAKE) -C mm -f Makefile.test TOPDIR="$(TOPDIR)" clean clean: subdir_clean - rm -f $(BIN) $(BIN).* mm_test *.map *~ + @rm -f $(BIN) $(BIN).* mm_test *.map *~ subdir_distclean: @for dir in $(CLEANDIRS) ; do \ @@ -227,6 +227,6 @@ subdir_distclean: done distclean: clean subdir_distclean clean_context - rm -f Make.defs setenv.sh .config + @rm -f Make.defs setenv.sh .config diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile index 445577b4af..9e6bda77cc 100644 --- a/arch/arm/src/Makefile +++ b/arch/arm/src/Makefile @@ -111,8 +111,8 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - @rm -f libarch$(LIBEXT) *~ - @if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libarch$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean @if [ -e board/Makefile ]; then \ diff --git a/arch/c5471/src/Makefile b/arch/c5471/src/Makefile index c04d9a9a68..1e7933b8fd 100644 --- a/arch/c5471/src/Makefile +++ b/arch/c5471/src/Makefile @@ -113,7 +113,8 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ fi - rm -f libarch$(LIBEXT) *.o *.obj *~ + @rm -f libarch$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean @if [ -e board/Makefile ]; then \ diff --git a/arch/dm320/src/Makefile b/arch/dm320/src/Makefile index 41b9a90ab2..8ce53aa741 100644 --- a/arch/dm320/src/Makefile +++ b/arch/dm320/src/Makefile @@ -113,12 +113,13 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ fi - rm -f libarch$(LIBEXT) *.o *.obj *~ + @rm -f libarch$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \ fi - rm -f Make.dep .depend + @rm -f Make.dep .depend -include Make.dep diff --git a/arch/pjrc-8051/src/Makefile b/arch/pjrc-8051/src/Makefile index 5d95b2f78d..d77bf546dd 100644 --- a/arch/pjrc-8051/src/Makefile +++ b/arch/pjrc-8051/src/Makefile @@ -211,9 +211,8 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ fi - rm -f libarch$(LIBEXT) up_mem.h - rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libarch$(LIBEXT) up_mem.h *~ .*.swp + $(call CLEAN) distclean: clean @if [ -e board/Makefile ]; then \ diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index c31c4e17ec..ea92eb50c8 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -101,8 +101,8 @@ nuttx$(EXEEXT): $(LINKOBJS) depend: .depend clean: - @rm -f libarch$(LIBEXT) *~ - @if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libarch$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean @rm -f Make.dep .depend diff --git a/arch/z16/src/Makefile b/arch/z16/src/Makefile index 2ce3a30130..cd06924471 100644 --- a/arch/z16/src/Makefile +++ b/arch/z16/src/Makefile @@ -99,8 +99,8 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - @rm -f libarch$(LIBEXT) *~ - @if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libarch$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean @if [ -e board/Makefile ]; then \ diff --git a/arch/z80/src/Makefile b/arch/z80/src/Makefile index 2c1f15c99b..9f5e752d44 100644 --- a/arch/z80/src/Makefile +++ b/arch/z80/src/Makefile @@ -234,10 +234,8 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - rm -f libarch$(LIBEXT) up_mem.h asm_mem.h pass1.* nuttx.* - rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex - rm -f core *~ .*.swp *.swp - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libarch$(LIBEXT) up_mem.h asm_mem.h pass1.* nuttx.* *~ .*.swp + $(call CLEAN) distclean: clean @if [ -e board/Makefile ]; then \ diff --git a/configs/README.txt b/configs/README.txt index 3bcb62e00a..fb6c655657 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -81,7 +81,7 @@ Make.defs -- This makefile fragment provides architecture and Tools: CC, LD, AR, NM, OBJCOPY, OBJDUMP Tool options: CFLAGS, LDFLAGS - COMPILE, ASSEMBLE, ARCHIVE, and MKDEP macros + COMPILE, ASSEMBLE, ARCHIVE, CLEAN, and MKDEP macros When this makefile fragment runs, it will be passed TOPDIR which is the path to the root directory of the build. This makefile diff --git a/configs/c5471evm/Make.defs b/configs/c5471evm/Make.defs index cda4d72082..bd44f0f7f9 100644 --- a/configs/c5471evm/Make.defs +++ b/configs/c5471evm/Make.defs @@ -84,6 +84,10 @@ define ARCHIVE $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.o *.a +endef + MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc diff --git a/configs/c5471evm/src/Makefile b/configs/c5471evm/src/Makefile index 4b0541ae16..9a05c01623 100644 --- a/configs/c5471evm/src/Makefile +++ b/configs/c5471evm/src/Makefile @@ -68,8 +68,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/configs/m68332evb/Make.defs b/configs/m68332evb/Make.defs index af4a880119..f12369c970 100644 --- a/configs/m68332evb/Make.defs +++ b/configs/m68332evb/Make.defs @@ -84,6 +84,10 @@ define ARCHIVE $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.o *.a +endef + MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc diff --git a/configs/m68332evb/src/Makefile b/configs/m68332evb/src/Makefile index a3c568cec6..0265ec858d 100644 --- a/configs/m68332evb/src/Makefile +++ b/configs/m68332evb/src/Makefile @@ -65,8 +65,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/configs/mcu123-lpc214x/Make.defs b/configs/mcu123-lpc214x/Make.defs index 356b6e9c70..70c1d8cc5e 100644 --- a/configs/mcu123-lpc214x/Make.defs +++ b/configs/mcu123-lpc214x/Make.defs @@ -84,6 +84,10 @@ define ARCHIVE $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.o *.a +endef + MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc diff --git a/configs/mcu123-lpc214x/src/Makefile b/configs/mcu123-lpc214x/src/Makefile index 93dea86be8..ab06f20022 100644 --- a/configs/mcu123-lpc214x/src/Makefile +++ b/configs/mcu123-lpc214x/src/Makefile @@ -68,8 +68,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/configs/ntosd-dm320/Make.defs b/configs/ntosd-dm320/Make.defs index 1be65e7b82..25acc1e41d 100644 --- a/configs/ntosd-dm320/Make.defs +++ b/configs/ntosd-dm320/Make.defs @@ -84,6 +84,10 @@ define ARCHIVE $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.o *.a +endef + MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc diff --git a/configs/ntosd-dm320/src/Makefile b/configs/ntosd-dm320/src/Makefile index de36b3d5cb..45a008c58c 100644 --- a/configs/ntosd-dm320/src/Makefile +++ b/configs/ntosd-dm320/src/Makefile @@ -68,8 +68,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/configs/pjrc-8051/Make.defs b/configs/pjrc-8051/Make.defs index 5c2482e37e..5c77c6f22a 100644 --- a/configs/pjrc-8051/Make.defs +++ b/configs/pjrc-8051/Make.defs @@ -77,6 +77,10 @@ define ARCHIVE $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex +endef + MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc diff --git a/configs/pjrc-8051/src/Makefile b/configs/pjrc-8051/src/Makefile index 31066a6372..0d6a7f05a2 100644 --- a/configs/pjrc-8051/src/Makefile +++ b/configs/pjrc-8051/src/Makefile @@ -67,9 +67,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) - rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/configs/sim/Make.defs b/configs/sim/Make.defs index 528d8cf53e..28069e16a3 100644 --- a/configs/sim/Make.defs +++ b/configs/sim/Make.defs @@ -83,6 +83,10 @@ define ARCHIVE $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.o *.a +endef + MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc diff --git a/configs/sim/src/Makefile b/configs/sim/src/Makefile index 55f6860917..076b917c5d 100644 --- a/configs/sim/src/Makefile +++ b/configs/sim/src/Makefile @@ -65,8 +65,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/configs/z16f2800100zcog/Make.defs b/configs/z16f2800100zcog/Make.defs index 7e1984384f..8c5b7edfd8 100644 --- a/configs/z16f2800100zcog/Make.defs +++ b/configs/z16f2800100zcog/Make.defs @@ -131,6 +131,10 @@ define ARCHIVE $(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.obj *.src *.lib *.hex +endef + # This is the tool to use for dependencies (i.e., none) MKDEP = $(TOPDIR)/tools/mknulldeps.sh diff --git a/configs/z16f2800100zcog/src/Makefile b/configs/z16f2800100zcog/src/Makefile index a479cdbe2f..33ac4263bc 100644 --- a/configs/z16f2800100zcog/src/Makefile +++ b/configs/z16f2800100zcog/src/Makefile @@ -70,8 +70,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/configs/z80sim/Make.defs b/configs/z80sim/Make.defs index 2e4c6db47b..75b6de6c83 100644 --- a/configs/z80sim/Make.defs +++ b/configs/z80sim/Make.defs @@ -82,6 +82,10 @@ define ARCHIVE $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } endef +define CLEAN + @rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex +endef + MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc diff --git a/configs/z80sim/src/Makefile b/configs/z80sim/src/Makefile index fba996597c..472037c585 100644 --- a/configs/z80sim/src/Makefile +++ b/configs/z80sim/src/Makefile @@ -67,9 +67,8 @@ libboard$(LIBEXT): $(OBJS) depend: .depend clean: - rm -f libboard$(LIBEXT) - rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex *~ - if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi + @rm -f libboard$(LIBEXT) *~ .*.swp + $(call CLEAN) distclean: clean rm -f Make.dep .depend diff --git a/drivers/Makefile b/drivers/Makefile index cfe0ab02d6..1655629d73 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -80,9 +80,10 @@ endif depend: .depend clean: - rm -f $(BIN) *.o *.obj *.rel *.asm *.lst *.sym *.adb *~ + @rm -f $(BIN) *~ .*.swp + $(call CLEAN) distclean: clean - rm -f Make.dep .depend + @rm -f Make.dep .depend -include Make.dep diff --git a/examples/mount/Makefile b/examples/mount/Makefile index bee957d072..71e75ed9bc 100644 --- a/examples/mount/Makefile +++ b/examples/mount/Makefile @@ -66,9 +66,10 @@ $(BIN): $(OBJS) depend: .depend clean: - rm -f $(BIN) *.o *.obj *.rel *.asm *.lst *.sym *.adb *~ + @rm -f $(BIN) *~ .*.swp + $(call CLEAN) distclean: clean - rm -f Make.dep .depend + @rm -f Make.dep .depend -include Make.dep diff --git a/examples/nettest/Makefile b/examples/nettest/Makefile index 1a917e3beb..0dd12ccbf4 100644 --- a/examples/nettest/Makefile +++ b/examples/nettest/Makefile @@ -97,9 +97,10 @@ $(HOST_BIN): $(HOST_OBJS) depend: .depend clean: - rm -f $(TARG_BIN) $(HOST_BIN) *.o *.obj *.rel *.asm *.lst *.sym *.adb *~ + @rm -f $(TARG_BIN) $(HOST_BIN) *~ .*.swp + $(call CLEAN) distclean: clean - rm -f Make.dep .depend + @rm -f Make.dep .depend -include Make.dep diff --git a/examples/nsh/Makefile b/examples/nsh/Makefile index 9c1bb7a780..2f1c2c804e 100644 --- a/examples/nsh/Makefile +++ b/examples/nsh/Makefile @@ -79,9 +79,10 @@ $(BIN): $(OBJS) depend: .depend clean: - rm -f $(BIN) *.o *.obj *.rel *.asm *.lst *.sym *.adb *~ + @rm -f $(BIN) *~ .*.swp + $(call CLEAN) distclean: clean - rm -f Make.dep .depend + @rm -f Make.dep .depend -include Make.dep diff --git a/examples/null/Makefile b/examples/null/Makefile index 39542b084d..3eb745b413 100644 --- a/examples/null/Makefile +++ b/examples/null/Makefile @@ -66,9 +66,10 @@ $(BIN): $(OBJS) depend: .depend clean: - rm -f $(BIN) *.o *.obj *.rel *.asm *.lst *.sym *.adb *~ + @rm -f $(BIN) *~ .*.swp + $(call CLEAN) distclean: clean - rm -f Make.dep .depend + @rm -f Make.dep .depend -include Make.dep