lexer_lex statemachine lexes correctly
[henge/webcc.git] / Makefile
index 504d0bb..8ce0adf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ SRC_DIR    := $(ROOT_DIR)/src
 # directory where files with 'main' functions live (can be in SRC_DIR)
 DRIVER_DIR := $(SRC_DIR)/bin
 # make configuration directory
-CONF_DIR   := $(ROOT_DIR)/.make
+CONF_DIR   := $(ROOT_DIR)/make
 # Source languages handled by this build system.  These languages are capable of
 # being compiled to an intermediary format for binary output by one of the
 # provided compilersfor each language
@@ -194,7 +194,7 @@ endef
 define SRC_LANG_RULE =
 $(if $($1),,$(eval $1 := t)\
 $(eval MOD  := $(filter $(MODULES),$(firstword $(subst /, ,$(subst $(SRC_DIR),,$(dir $1))))))\
-$(eval FLG  := $(MOD:%=-I% ))\
+$(eval FLG  := $(MOD:%=-I$(SRC_DIR)/% ))\
 $(if $(wildcard $1),
 $(eval DEPS  := $(filter-out \ %:,$(shell $($2_C) $(FLG) -M -MG $1)))\
 $(eval DDEPS := $(filter $(DRIVER_DIR:$(SRC_DIR)/%=%/%),$(DEPS)))\
@@ -258,7 +258,7 @@ $(eval DRIVER_MODULES := $(filter-out $(DRIVER_DIR) . ..,$(sort $(DRIVER_MODULES
 $(eval DRIVER_LDVALS  := $(file <$(1:%.$2=%.ld)))
 $(eval DRIVER_LFLAGS  := $(filter -l%,$(DRIVER_LDVALS)))
 $(eval DRIVER_MODULES += $(filter-out -l%,$(DRIVER_LDVALS)))
-
+$(eval DRIVER_MODULES := $(sort $(DRIVER_MODULES)))
 # List of module archives to link together during compilation
 $(eval DRIVER_ARCHIVES    := $(DRIVER_MODULES:%=$(SRC_DIR)/%.$($2_AROBJ)))
 $(eval DRIVER_DEPS        := $(DRIVER_SOB) $(DRIVER_ARCHIVES))
@@ -329,8 +329,8 @@ endef
 # a single locally-linked (no external -L libs) object (for simplified linking
 # modules as static libs).#######################################################
 define MODULE_ARCRULE =
-$(eval ARCDEPS := $(filter $1/%.$(c_OBJ),$(foreach lang,$(LANGS),$($(lang)_MOD_TRG))))\
-$(eval MAKE_TARGETS+= $1.$(c_AROBJ))\
+$(eval ARCDEPS := $(filter $(SRC_DIR)/$1/%.$(c_OBJ),$(foreach lang,$(LANGS),$($(lang)_MOD_TRG))))\
+$(eval MAKE_TARGETS+= $(SRC_DIR)/$1.$(c_AROBJ))\
 
 $(SRC_DIR)/$1.$(c_AROBJ): $(ARCDEPS)
        $(c_AR) cr $$@ $$^