diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-26 15:29:59 +0200 |
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-26 15:29:59 +0200 |
| commit | f3f471c65a8c1a16b203c4240a5e5ea1e09205ba (patch) | |
| tree | 3305f0622973846a32cccabe388adcf427c417d3 /src/simulator | |
| parent | 80739758ca113e3f205b14e047ab77f12a559df0 (diff) | |
| download | glutte-o-matic-f3f471c65a8c1a16b203c4240a5e5ea1e09205ba.tar.gz glutte-o-matic-f3f471c65a8c1a16b203c4240a5e5ea1e09205ba.tar.bz2 glutte-o-matic-f3f471c65a8c1a16b203c4240a5e5ea1e09205ba.zip | |
Improve vc.c generation
Diffstat (limited to 'src/simulator')
| -rw-r--r-- | src/simulator/Makefile | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/simulator/Makefile b/src/simulator/Makefile index ba2cc92..407e3c2 100644 --- a/src/simulator/Makefile +++ b/src/simulator/Makefile @@ -36,7 +36,7 @@ COMMON_SOURCE_LIST=$(shell cat ../common/sourcelist.txt) C_FILES+=$(COMMON_SOURCE_LIST:%.c=../common/%.c) # Main Object -SRC_SOURCES+=$(shell find -L src/ -name '*.c') +SRC_SOURCES+=$(shell find -L src/ -name '*.c' -not -name 'vc.c') C_FILES += $(SRC_SOURCES) # Include Paths @@ -48,6 +48,7 @@ INCLUDES += -I$(SRCROOT) # Generate OBJS names OBJS = $(patsubst %.c,%.o,$(C_FILES)) +OBJS += src/Core/vc.o ######## C Flags ######## @@ -101,6 +102,15 @@ _OBJS = $(patsubst %,$(ODIR)/%,$(OBJS)) dir_guard=@mkdir -p $(@D) +$(ODIR)/src/Core/vc.o: src/Core/vc.c vc.h + $(dir_guard) + @echo "[CC] version information vc.c" +ifeq ($(verbose),1) + $(CC) $(CFLAGS) src/Core/vc.c -c -o $(ODIR)/src/Core/vc.o +else + @$(CC) $(CFLAGS) src/Core/vc.c -c -o $(ODIR)/src/Core/vc.o +endif + $(ODIR)/%.o: %.c $(dir_guard) # If verbose, print gcc execution, else hide @@ -112,14 +122,16 @@ else @$(CC) $(CFLAGS) -c -o $@ $< endif - +.PHONY: vc.h vc.h: ../../.git/logs/HEAD @echo "// This file is generated by Makefile." > vc.h @echo "// Do not edit this file!" >> vc.h + @echo "const char* vc_get_version(void);" >> vc.h + @echo >> vc.h @git log -1 --format="format:#define GIT_VERSION \"%h\"" >> vc.h @echo >> vc.h @echo >> vc.h - @echo [EC] vc.h + @echo [GEN] vc.h FreeRTOS-Sim: $(_OBJS) @echo "[LK] $@" |
