Skip to content

Commit

Permalink
Most of the changes needed to support Windows native clean; distclean…
Browse files Browse the repository at this point in the history
… is has a problem

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5367 42af7a65-404d-4744-a932-0658087f49c3
  • Loading branch information
patacongo committed Nov 17, 2012
1 parent 43dda79 commit 26c9112
Show file tree
Hide file tree
Showing 31 changed files with 227 additions and 140 deletions.
23 changes: 16 additions & 7 deletions Makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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,
Expand Down
36 changes: 19 additions & 17 deletions Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
Expand All @@ -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,
Expand All @@ -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

6 changes: 4 additions & 2 deletions arch/8051/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions arch/arm/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions arch/avr/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

5 changes: 3 additions & 2 deletions arch/hc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions arch/mips/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 6 additions & 4 deletions arch/rgmp/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions arch/sh/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions arch/sim/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions arch/x86/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions arch/z16/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 8 additions & 2 deletions arch/z80/src/Makefile.sdcc
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions arch/z80/src/Makefile.zdsii
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 3 additions & 5 deletions binfmt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions configs/stm32f4discovery/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit 26c9112

Please sign in to comment.