Makefile: Make the dynamic rule creation a little bit simpler, thanks to the previous commit.

git-svn-id: https://svn.eduke32.com/eduke32@6423 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-08-06 13:44:52 +00:00
parent 0ebfd394d2
commit ccf09530e6

View file

@ -791,7 +791,7 @@ endif
.PHONY: \ .PHONY: \
all \ all \
start \ start \
$(foreach j,$(foreach i,$(games),$($i)) test utils tools,$j clean$j) \ $(addprefix clean,$(games) test utils tools) \
veryclean \ veryclean \
clean \ clean \
printutils \ printutils \
@ -814,7 +814,7 @@ start:
tools: $(addsuffix $(EXESUFFIX),$(tools_targets)) | start tools: $(addsuffix $(EXESUFFIX),$(tools_targets)) | start
@$(LL) $^ @$(LL) $^
$(foreach i,$(games),$($i)): $$(foreach i,$(roles),$$($$($$@)_$$i)$(EXESUFFIX)) | start $(games): $$(foreach i,$(roles),$$($$@_$$i)$(EXESUFFIX)) | start
@$(LL) $^ @$(LL) $^
ebacktrace: $(ebacktrace_dll) | start ebacktrace: $(ebacktrace_dll) | start
@ -825,6 +825,8 @@ ifneq ($(ELF2DOL),)
%$(DOLSUFFIX): %$(EXESUFFIX) %$(DOLSUFFIX): %$(EXESUFFIX)
endif endif
endif endif
define BUILDRULE define BUILDRULE
$$($1_$2)$$(EXESUFFIX): $$(foreach i,$(call getdeps,$1,$2),$$(call expandobjs,$$i)) $$($1_$2_miscdeps) | $$($1_$2_orderonlydeps) $$($1_$2)$$(EXESUFFIX): $$(foreach i,$(call getdeps,$1,$2),$$(call expandobjs,$$i)) $$($1_$2_miscdeps) | $$($1_$2_orderonlydeps)
@ -976,10 +978,10 @@ endif
clang-tools: $(filter %.c %.cpp,$(foreach i,$(call getdeps,duke3d,game),$(call expandsrcs,$i))) clang-tools: $(filter %.c %.cpp,$(foreach i,$(call getdeps,duke3d,game),$(call expandsrcs,$i)))
echo $^ -- -x c++ $(CXXONLYFLAGS) $(COMPILERFLAGS) $(foreach i,$(components),$($i_cflags)) $(CWARNS) echo $^ -- -x c++ $(CXXONLYFLAGS) $(COMPILERFLAGS) $(foreach i,$(components),$($i_cflags)) $(CWARNS)
$(foreach i,$(games),clean$($i)): $(addprefix clean,$(games)):
-rm -f $(foreach i,$(roles),$($($(subst clean,,$@))_$i)$(EXESUFFIX)) -rm -f $(foreach i,$(roles),$($(subst clean,,$@)_$i)$(EXESUFFIX))
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
-rm -rf $(foreach i,$(roles),"$($($(subst clean,,$@))_$i_proper).app") -rm -rf $(foreach i,$(roles),"$($(subst clean,,$@)_$i_proper).app")
endif endif
cleantools: cleantools: