mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 10:40:47 +00:00
Fix sequential GNUmakefile build
git-svn-id: https://svn.eduke32.com/eduke32@7786 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4a0071d3ef
commit
616b0c2347
3 changed files with 19 additions and 9 deletions
12
Common.mak
12
Common.mak
|
@ -11,6 +11,8 @@ SYNTHESIS := 0
|
||||||
override empty :=
|
override empty :=
|
||||||
override space := $(empty) $(empty)
|
override space := $(empty) $(empty)
|
||||||
override comma := ,
|
override comma := ,
|
||||||
|
override paren_open := (
|
||||||
|
override paren_close := )
|
||||||
|
|
||||||
|
|
||||||
##### Detect platform
|
##### Detect platform
|
||||||
|
@ -107,6 +109,7 @@ endif
|
||||||
DONT_PRINT := > $(NULLSTREAM) 2>&1
|
DONT_PRINT := > $(NULLSTREAM) 2>&1
|
||||||
DONT_PRINT_STDERR := 2> $(NULLSTREAM)
|
DONT_PRINT_STDERR := 2> $(NULLSTREAM)
|
||||||
DONT_FAIL := ; exit 0
|
DONT_FAIL := ; exit 0
|
||||||
|
ESCAPE=\\
|
||||||
|
|
||||||
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
|
||||||
|
@ -129,9 +132,13 @@ endef
|
||||||
define CAT
|
define CAT
|
||||||
cat $1
|
cat $1
|
||||||
endef
|
endef
|
||||||
|
define RAW_ECHO
|
||||||
|
echo '$1'
|
||||||
|
endef
|
||||||
|
|
||||||
ifeq (0,$(HAVE_SH))
|
ifeq (0,$(HAVE_SH))
|
||||||
DONT_FAIL := & rem
|
DONT_FAIL := & rem
|
||||||
|
ESCAPE=^
|
||||||
|
|
||||||
define LL
|
define LL
|
||||||
dir $(subst /,\,$1)
|
dir $(subst /,\,$1)
|
||||||
|
@ -146,7 +153,10 @@ ifeq (0,$(HAVE_SH))
|
||||||
rmdir /s /q $(subst /,\,$(filter-out / *,$1)) $(DONT_PRINT_STDERR) $(DONT_FAIL)
|
rmdir /s /q $(subst /,\,$(filter-out / *,$1)) $(DONT_PRINT_STDERR) $(DONT_FAIL)
|
||||||
endef
|
endef
|
||||||
define CAT
|
define CAT
|
||||||
type $1
|
type $(subst /,\,$1)
|
||||||
|
endef
|
||||||
|
define RAW_ECHO
|
||||||
|
echo $(subst ",$(ESCAPE)",$(subst $(paren_open),$(ESCAPE)$(paren_open),$(subst $(paren_close),$(ESCAPE)$(paren_close),$1)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# if, printf, exit, and ; are unavailable without sh
|
# if, printf, exit, and ; are unavailable without sh
|
||||||
|
|
16
GNUmakefile
16
GNUmakefile
|
@ -1008,16 +1008,16 @@ $$($1_obj)/%.$$o: $$($1_src)/%.mm | $$($1_obj)
|
||||||
$$(COMPILE_STATUS)
|
$$(COMPILE_STATUS)
|
||||||
$$(RECIPE_IF) $$(COMPILER_OBJCXX) $$($1_cflags) -c $$< -o $$@ $$(RECIPE_RESULT_COMPILE)
|
$$(RECIPE_IF) $$(COMPILER_OBJCXX) $$($1_cflags) -c $$< -o $$@ $$(RECIPE_RESULT_COMPILE)
|
||||||
|
|
||||||
$$($1_obj)/%.$$o: $$($1_obj)/%.c
|
$$($1_obj)/%.$$o: $$($1_obj)/%.c | $$($1_obj)
|
||||||
$$(COMPILE_STATUS)
|
$$(COMPILE_STATUS)
|
||||||
$$(RECIPE_IF) $$(COMPILER_C) $$($1_cflags) -c $$< -o $$@ $$(RECIPE_RESULT_COMPILE)
|
$$(RECIPE_IF) $$(COMPILER_C) $$($1_cflags) -c $$< -o $$@ $$(RECIPE_RESULT_COMPILE)
|
||||||
|
|
||||||
$$($1_obj)/%.$$o: $$($1_src)/%.glsl | $$($1_src)/generated
|
$$($1_obj)/%.$$o: $$($1_src)/%.glsl | $$($1_obj) $$($1_src)/generated
|
||||||
echo "Creating header from "$$<
|
@echo Creating $$(<D)/generated/$$(<F).h from $$<
|
||||||
echo "char const *$$(basename $$(<F)) = R\"shader(" > $$(<D)/generated/$$(<F).h
|
@$$(call RAW_ECHO,char const *$$(basename $$(<F)) = R"shader$$(paren_open)) > $$(<D)/generated/$$(<F).h
|
||||||
$$(CAT) $$< >> $$(<D)/generated/$$(<F).h
|
@$$(call CAT,$$<) >> $$(<D)/generated/$$(<F).h
|
||||||
echo ")shader\";" >> $$(<D)/generated/$$(<F).h
|
@$$(call RAW_ECHO,$$(paren_close)shader";) >> $$(<D)/generated/$$(<F).h
|
||||||
echo " " | $$(COMPILER_CXX) $$($1_cflags) -x c++ -c - -o $$@
|
@$$(COMPILER_CXX) $$($1_cflags) -x c++ -c $$($1_src)/empty.cpp -o $$@
|
||||||
|
|
||||||
## Cosmetic stuff
|
## Cosmetic stuff
|
||||||
|
|
||||||
|
@ -1052,7 +1052,7 @@ $(engine_obj)/rev.$o: $(engine_src)/rev.cpp | $(engine_obj)
|
||||||
|
|
||||||
### Directories
|
### Directories
|
||||||
|
|
||||||
$(foreach i,$(components),$($i_obj)):
|
$(foreach i,$(components),$($i_obj)) $(foreach i,$(components),$($i_src)/generated):
|
||||||
-$(call MKDIR,$@)
|
-$(call MKDIR,$@)
|
||||||
|
|
||||||
### Phonies
|
### Phonies
|
||||||
|
|
0
source/build/src/empty.cpp
Normal file
0
source/build/src/empty.cpp
Normal file
Loading…
Reference in a new issue