Merge branch 'master' of krull:apc
authorJordan <jordanlavatai@gmail.com>
Fri, 17 Feb 2017 00:47:06 +0000 (16:47 -0800)
committerJordan <jordanlavatai@gmail.com>
Fri, 17 Feb 2017 00:47:06 +0000 (16:47 -0800)
Makefile
src/ir.c

index ad90bba..62bf119 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -62,6 +62,8 @@ ifeq (,$(filter clean,$(MAKECMDGOALS)))
 # Deps should be generated for each source file, when not cleaning
 cGENDEP = $(if $(wildcard $1),$(subst $(dir $1),,$(filter-out $1 \ %:,$(shell $(CC) -MM -MG $1))),\
 $(info [<$1>: no deps - file not found]))
+# Filter only missing deps
+cMISDEP = $(strip $(foreach dep,$(call cGENDEP,$1),$(if $(wildcard src/$(dep)),,$(dep))))
 # S2S will print the command necessary to create a file when called
 S2S  = $(if $(filter $2,$(call NEWER,$2,$3)),$(eval 4 := t),$(eval 4 :=))
 S2S += $(if $4,$(info $(call $1,$2,$3)))
@@ -78,7 +80,8 @@ cleanCMD = $(if $(wildcard $1),rm $(wildcard $(sort $1)))
 .SECONDEXPANSION:
 $(ldTRG): $$(call ldDEP,$$@) | $(hGEN) ; $(call LDCMD,$^,$@)
 %-d.o: CFLAGS+= -Og -ggdb -DDEBUG=$(DEBUG)
-%.o %-d.o: %.c $$(call cGENDEP,$$(dir $$@)%.c) ; $(call CCMD,$<,$@)
+%.o %-d.o: %.c $$(call cGENDEP,$$(dir $$@)%.c); $(call CCMD,$<,$@)
+%.o %-d.o: %.c; $(error Missing dependencies for $<: $(call cMISDEP, $<))
 %.tab.h: %.tab.c ;
 %.tab.c: %.y $$(call S2S,YCMD,%.y,$$@) ;
 %.fsm.c: %.rl $$(call S2S,RLCMD,%.rl,$$@) ;
index c59441a..d6ad16f 100644 (file)
--- a/src/ir.c
+++ b/src/ir.c
@@ -679,13 +679,14 @@ union ir_setdata_t* ir_framebox_mapsheet
 }\r
 \r
 /* Return a framedata's frame info */\r
-struct ir_frameinfo_t* ir_framedata_mapsheet\r
+struct ir_frameinfo_t* ir_framedata_frameinfo\r
 ( union ir_setdata_t* framedata )\r
 { if (framedata->header.type != MSDAT && framedata->header.type != FSDAT)\r
     eprintf("Data %s is not a framedata\n", framedata->header.data_name);\r
   return &framedata->mapsheet.frameinfo;\r
 }\r
 \r
+\r
 /** Allocators **/\r
 static\r
 uint8_t* name_alloc\r