Commit 84b46acf
84b46acfc919Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
Merge pull request #230 from ryanseys/rs-makefile-split-test-link
build: split test/bench compile+link to enable compiler caching
Details
- Commit
- 84b46acfc919
- Parent
- a9dd360aed33
- Merge parent
- 1cc4c9df6a9a
MakefilemodifiedView file
@@ -229,7 +229,8 @@
230230
./spinel_parse$(EXE) "$<" "$$ast" 2>/dev/null && \231231
./spinel_codegen$(EXE) "$$ast" "$$cfile" 2>/dev/null && \232-
$(CC) $(CFLAGS) -Werror $(SEC_FLAGS) -Ilib "$$cfile" $(SP_RT_LIB) $(LDFLAGS) -lm $(GC_FLAGS) -o "$$bin" 2>/dev/null; \232+
$(CC) $(CFLAGS) -Werror $(SEC_FLAGS) -Ilib -c "$$cfile" -o "$$cfile.o" 2>/dev/null && \233+
$(CC) $(CFLAGS) "$$cfile.o" $(SP_RT_LIB) $(LDFLAGS) -lm $(GC_FLAGS) -o "$$bin" 2>/dev/null; \233234
if [ $$? -eq 0 ]; then \234235
if [ -f "$<.expected" ]; then \235236
LC_ALL=C sed 's/\r$$//' "$<.expected" >"$$exp.n"; \@@ -291,7 +292,8 @@
291292
if [ "$$tty" = 1 ]; then printf '\r\033[K [%d/%d] %s' "$$i" "$$total" "$$bn"; fi; \292293
$(TIMEOUT10) ./spinel_parse$(EXE) "$$f" /tmp/_sp_b.ast 2>/dev/null && \293294
$(TIMEOUT10) ./spinel_codegen$(EXE) /tmp/_sp_b.ast /tmp/_sp_b.c 2>/dev/null && \294-
$(CC) $(CFLAGS) -Werror $(SEC_FLAGS) -Ilib /tmp/_sp_b.c $(SP_RT_LIB) $(LDFLAGS) -lm $(GC_FLAGS) -o /tmp/_sp_b_bin$(EXE) 2>/dev/null; \295+
$(CC) $(CFLAGS) -Werror $(SEC_FLAGS) -Ilib -c /tmp/_sp_b.c -o /tmp/_sp_b.c.o 2>/dev/null && \296+
$(CC) $(CFLAGS) /tmp/_sp_b.c.o $(SP_RT_LIB) $(LDFLAGS) -lm $(GC_FLAGS) -o /tmp/_sp_b_bin$(EXE) 2>/dev/null; \295297
if [ $$? -eq 0 ]; then \296298
$(TIMEOUT60) $(REF_RUBY) "$$f" >/tmp/_sp_b_exp 2>/dev/null; \297299
ruby_rc=$$?; \@@ -321,7 +323,7 @@
321323
fi; \322324
done; \323325
if [ "$$tty" = 1 ]; then printf '\r\033[K'; fi; \324-
rm -f /tmp/_sp_b.ast /tmp/_sp_b.c /tmp/_sp_b_bin$(EXE) /tmp/_sp_b_exp /tmp/_sp_b_act /tmp/_sp_b_exp.n /tmp/_sp_b_act.n; \326+
rm -f /tmp/_sp_b.ast /tmp/_sp_b.c /tmp/_sp_b.c.o /tmp/_sp_b_bin$(EXE) /tmp/_sp_b_exp /tmp/_sp_b_act /tmp/_sp_b_exp.n /tmp/_sp_b_act.n; \325327
echo "Benchmarks: $$pass pass, $$fail fail, $$err error, $$skip skip"; \326328
if [ $$fail -ne 0 ] || [ $$err -ne 0 ]; then exit 1; fi327329