]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
Makefile: Generate dependencies for gio_names.txt
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 4 Oct 2015 10:33:53 +0000 (12:33 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 4 Oct 2015 10:33:53 +0000 (12:33 +0200)
This ensures that this file gets rebuilt when gio_def.h changes. We must
work around a TI compiler bug for this to work.

build/Makefile.lib.inc
build/Makefile.rules.arm

index c35a511ac2a3c09125ae0e3e99420c852b3e863b..9dbe3f64ebb738ddd0320e9c7875188258fbbf63 100644 (file)
@@ -40,7 +40,7 @@ endif
 rpp_lib_c_OBJS   = $(addsuffix .obj,$(basename $(filter %.c,   $(rpp_lib_SOURCES))))
 rpp_lib_asm_OBJS = $(addsuffix .obj,$(basename $(filter %.asm, $(rpp_lib_SOURCES))))
 rpp_lib_OBJS = $(rpp_lib_c_OBJS) $(rpp_lib_asm_OBJS)
-rpp_lib_DEPS = $(rpp_lib_OBJS:%=%.dep)
+rpp_lib_DEPS = $(rpp_lib_OBJS:%=%.dep) rpp/src/gio_names.txt.dep
 
 rpp-lib.lib: $(rpp_lib_OBJS) #../rpp/TMS570LS313xFlashLnk.cmd
        $(AR) r $@ $^
@@ -64,6 +64,12 @@ rpp/src/gio_names.txt: %: $(makefile_lib_inc_dir)/../%.tmpl
        $(call mkdir,$(dir $@))
        $(RPP_PREPROC_CMD)
 
+# Work around TI compiler bug in dependency generation - it always
+# adds .obj even if the output file lacks this extension.
+rpp/src/gio_names.txt: rpp/src/gio_names.txt.obj
+rpp/src/gio_names.txt.obj:
+       $(call mkdir,$(dir $@))
+       echo xxx > $(call pathconv,$@)
 
 .PHONY: all clean $(makefile_lib_inc_dir)/../rpp-lib.lib
 
index b730edab79fc93c5b9b89711b425d0ff135b3cf2..a1d13c13cb733790e96c87395a730121a3d24274 100644 (file)
@@ -59,7 +59,9 @@ RPP_MAKE_CFLAGS = \
                --preproc_with_compile
 
 RPP_COMPILE_CMD = $(CC) $(RPP_CFLAGS) $(RPP_MAKE_CFLAGS) $<
-RPP_PREPROC_CMD = $(CC) $(RPP_CFLAGS) --preproc_only --output_file=$@ $<
+RPP_PREPROC_CMD = $(CC) $(RPP_CFLAGS) --preproc_dependency=$(@:%=%.dep) --obj_directory=$(dir $@) $< && \
+                                 $(CC) $(RPP_CFLAGS) --preproc_only --output_file=$@ $<
+
 
 BUILD_DIR ?= Debug
 RPP_LIB_DIR = $(makefile_rules_arm_dir)/$(TARGET)/$(BUILD_DIR)