projects
/
henge
/
webcc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Buildsys2
[henge/webcc.git]
/
src
/
Makefile
diff --git
a/src/Makefile
b/src/Makefile
index
4e22f2f
..
c6262fd
100644
(file)
--- a/
src/Makefile
+++ b/
src/Makefile
@@
-8,7
+8,7
@@
#Executable name, also passed as -DAPPNAME to compiler
APPNAME := the_march
#Directory in which we expect to find main()
#Executable name, also passed as -DAPPNAME to compiler
APPNAME := the_march
#Directory in which we expect to find main()
-APP
SRC
:= core
+APP
MODULE
:= core
#Compiler flags for the final executable
APPFLAGS :=
#Object files statically linked for the executable
#Compiler flags for the final executable
APPFLAGS :=
#Object files statically linked for the executable
@@
-26,17
+26,20
@@
EMFLAGS :=
#Import the build system setup
include .make/build.mk
#Import the build system setup
include .make/build.mk
+#Directories to be constructed
+DIRS := $(sort $(dir $(APPDEPS) $(APPTARG)))
+
#Targets that don't generate a file
.PHONY: $(APPNAME) run push dox doc clean scrub all default
#Define default rules to point to APPNAME
all default: $(APPTARG)
#Build the executable
#Targets that don't generate a file
.PHONY: $(APPNAME) run push dox doc clean scrub all default
#Define default rules to point to APPNAME
all default: $(APPTARG)
#Build the executable
-$(APPNAME) $(APPTARG): $(
APPDEPS) | $(APPDIR
S)
- $(
CC) -o $(APPTARG) $(APPFLAGS) $(APPDEPS
)
+$(APPNAME) $(APPTARG): $(
DIRS) $(APPDEP
S)
+ $(
APPC) -o $(APPTARG) $(APPFLAGS) $(APPSRC
)
#create directories
#create directories
-$(
APP
DIRS):
+$(DIRS):
@mkdir -p $@
#run the game after making it
@mkdir -p $@
#run the game after making it
@@
-67,7
+70,7
@@
scrub: | clean
#Generate and evaluate C dependencies
$(foreach base,$(basename $(sort $(strip $(CTARG)))),\
#Generate and evaluate C dependencies
$(foreach base,$(basename $(sort $(strip $(CTARG)))),\
- $(eval $(strip $(base)$(COBJSUF): $(shell $(subst $BASE,$(base),$(C
GENDEP)))
)))
+ $(eval $(strip $(base)$(COBJSUF): $(shell $(subst $BASE,$(base),$(C
DEPSCOMMAND)))) $(CDEPS
)))
#new default C build rule
%.bc %.o: %.c $(CDEPS)
#new default C build rule
%.bc %.o: %.c $(CDEPS)
@@
-75,11
+78,13
@@
$(foreach base,$(basename $(sort $(strip $(CTARG)))),\
#construct list of cp rules for each web item
ifdef WEBTARG
#construct list of cp rules for each web item
ifdef WEBTARG
-$(WEBTARG): $(
HTMLDIR)/$(filter-out $(EXEDIR),$@
)
- cp -f $
<
$@
+$(WEBTARG): $(
subst $(DISTDIR),$(HTSRCDIR),$(WEBTARG)
)
+ cp -f $
(subst $(DISTDIR),$(HTSRCDIR),$@)
$@
endif
endif
-#force including rules for making each lib in this case
+#force including rules for making each lib if
+#we have identified any missing libs
+#(fail if no rule exists)
ifdef MISSINGLIBS
include $(foreach lib,$(MISSINGLIBS),.make/lib$(lib).mk)
endif
ifdef MISSINGLIBS
include $(foreach lib,$(MISSINGLIBS),.make/lib$(lib).mk)
endif