Skip to content
Snippets Groups Projects
Commit 5f4d7e3c authored by James R.'s avatar James R.
Browse files

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.
parent d5146945
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
#
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment