Unix 'make clean' and 'make spotless'
Provide a reasonably straightforward way to leave lua alone when changing git branches (which I precede with 'make spotless'). make clean-keep-lib and make spotless-keep-lib are new alternate forms of top level 'make clean' and 'make spotless' that won't touch lib/lua/.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# NetHack Makefile.
|
# NetHack Makefile.
|
||||||
# NetHack 3.7 Makefile.src $NHDT-Date: 1601854487 2020/10/04 23:34:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.111 $
|
# NetHack 3.7 Makefile.src $NHDT-Date: 1609702027 2021/01/03 19:27:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.117 $
|
||||||
# Copyright (c) 2018 by Pasi Kallinen
|
# Copyright (c) 2018 by Pasi Kallinen
|
||||||
# NetHack may be freely redistributed. See license for details.
|
# NetHack may be freely redistributed. See license for details.
|
||||||
|
|
||||||
@@ -794,11 +794,12 @@ tags: $(CSOURCES)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o $(HACK_H) $(CONFIG_H)
|
-rm -f *.o $(HACK_H) $(CONFIG_H)
|
||||||
|
-rm monstr.c vis_tab.c ../include/vis_tab.h #obsolete generated files
|
||||||
$(CLEANMORE)
|
$(CLEANMORE)
|
||||||
|
|
||||||
spotless: clean
|
spotless: clean
|
||||||
-rm -f a.out core $(GAMEBIN) Sys*
|
-rm -f a.out core $(GAMEBIN) Sys*
|
||||||
-rm -f ../lib/lua/liblua.a ../include/nhlua.h
|
-rm -f ../include/nhlua.h
|
||||||
-rm -f ../include/date.h ../include/onames.h ../include/pm.h
|
-rm -f ../include/date.h ../include/onames.h ../include/pm.h
|
||||||
-rm -f tile.c *.moc
|
-rm -f tile.c *.moc
|
||||||
-rm -f ../win/gnome/gn_rip.h
|
-rm -f ../win/gnome/gn_rip.h
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# NetHack Top-level Makefile.
|
# NetHack Top-level Makefile.
|
||||||
# NetHack 3.7 Makefile.top $NHDT-Date: 1609074072 2020/12/27 13:01:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.65 $
|
# NetHack 3.7 Makefile.top $NHDT-Date: 1609702004 2021/01/03 19:26:44 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.66 $
|
||||||
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
|
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
|
||||||
# NetHack may be freely redistributed. See license for details.
|
# NetHack may be freely redistributed. See license for details.
|
||||||
|
|
||||||
@@ -318,16 +318,27 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs
|
|||||||
|
|
||||||
# 'make clean' removes all the .o files, but leaves around all the executables
|
# 'make clean' removes all the .o files, but leaves around all the executables
|
||||||
# and compiled data files
|
# and compiled data files
|
||||||
clean:
|
clean: clean-lib clean-keep-lib
|
||||||
|
@true
|
||||||
|
|
||||||
|
clean-lib:
|
||||||
|
-( cd lib/lua-$(LUA_VERSION)/src && $(MAKE) clean )
|
||||||
|
|
||||||
|
clean-keep-lib:
|
||||||
( cd src ; $(MAKE) clean )
|
( cd src ; $(MAKE) clean )
|
||||||
( cd util ; $(MAKE) clean )
|
( cd util ; $(MAKE) clean )
|
||||||
( cd dat ; $(MAKE) clean )
|
( cd dat ; $(MAKE) clean )
|
||||||
( cd doc ; $(MAKE) clean )
|
( cd doc ; $(MAKE) clean )
|
||||||
-( cd lib/lua-$(LUA_VERSION)/src && $(MAKE) clean )
|
|
||||||
|
|
||||||
# 'make spotless' returns the source tree to near-distribution condition.
|
# 'make spotless' returns the source tree to near-distribution condition.
|
||||||
# it removes .o files, executables, and compiled data files
|
# it removes .o files, executables, and compiled data files
|
||||||
spotless:: clean
|
spotless:: spotless-lib spotless-keep-lib
|
||||||
|
@true
|
||||||
|
|
||||||
|
spotless-lib:: clean-lib
|
||||||
|
-( cd lib/lua && rm liblua.a )
|
||||||
|
|
||||||
|
spotless-keep-lib: clean-keep-lib
|
||||||
( cd src ; $(MAKE) spotless )
|
( cd src ; $(MAKE) spotless )
|
||||||
( cd util ; $(MAKE) spotless )
|
( cd util ; $(MAKE) spotless )
|
||||||
( cd dat ; $(MAKE) spotless )
|
( cd dat ; $(MAKE) spotless )
|
||||||
|
|||||||
Reference in New Issue
Block a user