mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Makefile: fail if old build directories exist
After a checkout from before revision, old directories such as bin/Linux64 only remain if untracked files exist within. This may be confusing to the user. They may even use an outdated executable if it is one of those untracked files.
This commit is contained in:
parent
d5146945a6
commit
5f4d7e3c5b
2 changed files with 21 additions and 1 deletions
|
@ -132,6 +132,10 @@ goals:=$(or $(MAKECMDGOALS),all)
|
|||
cleanonly:=$(filter $(clean_targets),$(goals))
|
||||
destructive:=$(filter-out info,$(cleanonly))
|
||||
|
||||
ifndef cleanonly
|
||||
include Makefile.d/old.mk
|
||||
endif
|
||||
|
||||
include Makefile.d/util.mk
|
||||
|
||||
ifdef PREFIX
|
||||
|
@ -399,7 +403,7 @@ clean :
|
|||
$(call _rm,$(exe) $(dbg) $(dbg).txt $(objects))
|
||||
|
||||
distclean :
|
||||
$(call _rm,../bin ../objs ../deps comptime.h)
|
||||
$(call _rm,../bin ../objs ../deps ../make comptime.h)
|
||||
|
||||
info:
|
||||
ifdef WINDOWSHELL
|
||||
|
|
16
src/Makefile.d/old.mk
Normal file
16
src/Makefile.d/old.mk
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# Warn about old build directories and offer to purge.
|
||||
#
|
||||
|
||||
_old:=$(wildcard $(addprefix ../bin/,FreeBSD Linux \
|
||||
Linux64 Mingw Mingw64 SDL dummy) ../objs ../deps)
|
||||
|
||||
ifdef _old
|
||||
$(foreach v,$(_old),$(info $(abspath $(v))))
|
||||
$(info )
|
||||
$(info These directories are no longer\
|
||||
required and should be removed.)
|
||||
$(info You may remove them manually or\
|
||||
by using 'make distclean')
|
||||
$(error )
|
||||
endif
|
Loading…
Reference in a new issue