#Executable name, also passed as -DAPPNAME to compiler
APPNAME := the_march
#Directory in which we expect to find main()
-APPSRC := core
+APPMODULE := core
#Compiler flags for the final executable
APPFLAGS :=
#Object files statically linked for the executable
#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
-$(APPNAME) $(APPTARG): $(APPDEPS) | $(APPDIRS)
- $(CC) -o $(APPTARG) $(APPFLAGS) $(APPDEPS)
+$(APPNAME) $(APPTARG): $(DIRS) $(APPDEPS)
+ $(APPC) -o $(APPTARG) $(APPFLAGS) $(APPSRC)
#create directories
-$(APPDIRS):
+$(DIRS):
@mkdir -p $@
#run the game after making it
#Generate and evaluate C dependencies
$(foreach base,$(basename $(sort $(strip $(CTARG)))),\
- $(eval $(strip $(base)$(COBJSUF): $(shell $(subst $BASE,$(base),$(CGENDEP))))))
+ $(eval $(strip $(base)$(COBJSUF): $(shell $(subst $BASE,$(base),$(CDEPSCOMMAND)))) $(CDEPS)))
#new default C build rule
%.bc %.o: %.c $(CDEPS)
#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
-#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