mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
Makefile: More no-shell stuff that I didn't want to rebase past the lowercase stuff.
git-svn-id: https://svn.eduke32.com/eduke32@6424 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ccf09530e6
commit
eb332f21a4
2 changed files with 40 additions and 17 deletions
30
Common.mak
30
Common.mak
|
@ -104,9 +104,9 @@ ifeq ($(HOSTPLATFORM),WINDOWS)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LL := ls -l
|
|
||||||
DONT_PRINT := > $(NULLSTREAM) 2>&1
|
DONT_PRINT := > $(NULLSTREAM) 2>&1
|
||||||
DONT_PRINT_STDERR := 2> $(NULLSTREAM)
|
DONT_PRINT_STDERR := 2> $(NULLSTREAM)
|
||||||
|
DONT_FAIL := ; exit 0
|
||||||
|
|
||||||
HAVE_SH := 1
|
HAVE_SH := 1
|
||||||
# when no sh.exe is found in PATH on Windows, no path is prepended to it
|
# when no sh.exe is found in PATH on Windows, no path is prepended to it
|
||||||
|
@ -114,8 +114,34 @@ ifeq (sh.exe,$(SHELL))
|
||||||
HAVE_SH := 0
|
HAVE_SH := 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
define LL
|
||||||
|
ls -l $1
|
||||||
|
endef
|
||||||
|
define MKDIR
|
||||||
|
mkdir -p $1
|
||||||
|
endef
|
||||||
|
define RM
|
||||||
|
rm -f $(filter-out / *,$1)
|
||||||
|
endef
|
||||||
|
define RMDIR
|
||||||
|
rm -rf $(filter-out / *,$1)
|
||||||
|
endef
|
||||||
|
|
||||||
ifeq (0,$(HAVE_SH))
|
ifeq (0,$(HAVE_SH))
|
||||||
LL := dir
|
DONT_FAIL := & rem
|
||||||
|
|
||||||
|
define LL
|
||||||
|
dir $(subst /,\,$1)
|
||||||
|
endef
|
||||||
|
define MKDIR
|
||||||
|
if not exist $(subst /,\,$1) mkdir $(subst /,\,$1)
|
||||||
|
endef
|
||||||
|
define RM
|
||||||
|
del /f /q $(subst /,\,$(filter-out / *,$1)) $(DONT_PRINT_STDERR) $(DONT_FAIL)
|
||||||
|
endef
|
||||||
|
define RMDIR
|
||||||
|
rmdir /s /q $(subst /,\,$(filter-out / *,$1)) $(DONT_PRINT_STDERR) $(DONT_FAIL)
|
||||||
|
endef
|
||||||
|
|
||||||
# if, printf, exit, and ; are unavailable without sh
|
# if, printf, exit, and ; are unavailable without sh
|
||||||
PRETTY_OUTPUT := 0
|
PRETTY_OUTPUT := 0
|
||||||
|
|
27
GNUmakefile
27
GNUmakefile
|
@ -812,13 +812,13 @@ start:
|
||||||
$(BUILD_STARTED)
|
$(BUILD_STARTED)
|
||||||
|
|
||||||
tools: $(addsuffix $(EXESUFFIX),$(tools_targets)) | start
|
tools: $(addsuffix $(EXESUFFIX),$(tools_targets)) | start
|
||||||
@$(LL) $^
|
@$(call LL,$^)
|
||||||
|
|
||||||
$(games): $$(foreach i,$(roles),$$($$@_$$i)$(EXESUFFIX)) | start
|
$(games): $$(foreach i,$(roles),$$($$@_$$i)$(EXESUFFIX)) | start
|
||||||
@$(LL) $^
|
@$(call LL,$^)
|
||||||
|
|
||||||
ebacktrace: $(ebacktrace_dll) | start
|
ebacktrace: $(ebacktrace_dll) | start
|
||||||
@$(LL) $^
|
@$(call LL,$^)
|
||||||
|
|
||||||
ifeq ($(PLATFORM),WII)
|
ifeq ($(PLATFORM),WII)
|
||||||
ifneq ($(ELF2DOL),)
|
ifneq ($(ELF2DOL),)
|
||||||
|
@ -842,7 +842,7 @@ ifneq ($$(STRIP),)
|
||||||
endif
|
endif
|
||||||
ifeq ($$(PLATFORM),DARWIN)
|
ifeq ($$(PLATFORM),DARWIN)
|
||||||
cp -RPf "platform/Apple/bundles/$$($1_$2_proper).app" "./"
|
cp -RPf "platform/Apple/bundles/$$($1_$2_proper).app" "./"
|
||||||
mkdir -p "$$($1_$2_proper).app/Contents/MacOS"
|
$(call MKDIR,"$$($1_$2_proper).app/Contents/MacOS")
|
||||||
cp -f "$$($1_$2)$$(EXESUFFIX)" "$$($1_$2_proper).app/Contents/MacOS/"
|
cp -f "$$($1_$2)$$(EXESUFFIX)" "$$($1_$2_proper).app/Contents/MacOS/"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -965,13 +965,8 @@ $(engine_obj)/rev.$o: $(engine_src)/rev.cpp | $(engine_obj)
|
||||||
|
|
||||||
### Directories
|
### Directories
|
||||||
|
|
||||||
ifeq (0,$(HAVE_SH))
|
|
||||||
$(foreach i,$(components),$($i_obj)):
|
$(foreach i,$(components),$($i_obj)):
|
||||||
-if not exist $(subst /,\,$@) mkdir $(subst /,\,$@)
|
-$(call MKDIR,$@)
|
||||||
else
|
|
||||||
$(foreach i,$(components),$($i_obj)):
|
|
||||||
-mkdir -p $@ ; exit 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
### Phonies
|
### Phonies
|
||||||
|
|
||||||
|
@ -979,17 +974,19 @@ clang-tools: $(filter %.c %.cpp,$(foreach i,$(call getdeps,duke3d,game),$(call e
|
||||||
echo $^ -- -x c++ $(CXXONLYFLAGS) $(COMPILERFLAGS) $(foreach i,$(components),$($i_cflags)) $(CWARNS)
|
echo $^ -- -x c++ $(CXXONLYFLAGS) $(COMPILERFLAGS) $(foreach i,$(components),$($i_cflags)) $(CWARNS)
|
||||||
|
|
||||||
$(addprefix clean,$(games)):
|
$(addprefix clean,$(games)):
|
||||||
-rm -f $(foreach i,$(roles),$($(subst clean,,$@)_$i)$(EXESUFFIX))
|
-$(call RM,$(foreach i,$(roles),$($(subst clean,,$@)_$i)$(EXESUFFIX)))
|
||||||
|
-$(call RMDIR,$($(subst clean,,$@)_obj))
|
||||||
ifeq ($(PLATFORM),DARWIN)
|
ifeq ($(PLATFORM),DARWIN)
|
||||||
-rm -rf $(foreach i,$(roles),"$($(subst clean,,$@)_$i_proper).app")
|
-$(call RMDIR,$(foreach i,$(roles),"$($(subst clean,,$@)_$i_proper).app"))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cleantools:
|
cleantools:
|
||||||
-rm -f $(addsuffix $(EXESUFFIX),$(tools_targets))
|
-$(call RM,$(addsuffix $(EXESUFFIX),$($(subst clean,,$@)_targets)))
|
||||||
|
-$(call RMDIR,$($(subst clean,,$@)_obj))
|
||||||
|
|
||||||
clean: cleanduke3d cleantools
|
clean: cleanduke3d cleantools
|
||||||
-rm -rf $(obj)/
|
-$(call RMDIR,$(obj))
|
||||||
-rm -f $(ebacktrace_dll)
|
-$(call RM,$(ebacktrace_dll))
|
||||||
|
|
||||||
printtools:
|
printtools:
|
||||||
echo "$(addsuffix $(EXESUFFIX),$(tools_targets))"
|
echo "$(addsuffix $(EXESUFFIX),$(tools_targets))"
|
||||||
|
|
Loading…
Reference in a new issue