summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-01-19 11:43:50 -0500
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-01-19 11:43:50 -0500
commit10c0566121cb923b7f4e6c1a97a1df8ad70cb327 (patch)
tree9aac83d3fd42c4c0331d6cb4c7d2dcf5fee69351 /Makefile
parent98f8c96c9e21791651d2274f07046496ab826ff2 (diff)
Don't keep temporary C build files by default.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 3bb5161e3..3383cb14d 100644
--- a/Makefile
+++ b/Makefile
@@ -283,10 +283,15 @@ override CFLAGS += -g
endif
$(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep)
+ifeq (,$(KEEP_TEMPS))
+ @echo "$(CC1) <flags> -o $@ $<"
+ @$(CPP) $(CPPFLAGS) $< | $(PREPROC) $< charmap.txt -i | { $(CC1) $(CFLAGS) -o - -; echo -e ".text\n\t.align\t2, 0"; } | $(AS) $(ASFLAGS) -o $@ -
+else
@$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i
@$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s
@echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s
+endif
ifeq ($(NODEP),1)
$(GFLIB_BUILDDIR)/%.o: c_dep :=
@@ -295,10 +300,15 @@ $(GFLIB_BUILDDIR)/%.o: c_dep = $(shell [[ -f $(GFLIB_SUBDIR)/$*.c ]] && $(SCANIN
endif
$(GFLIB_BUILDDIR)/%.o : $(GFLIB_SUBDIR)/%.c $$(c_dep)
+ifeq (,$(KEEP_TEMPS))
+ @echo "$(CC1) <flags> -o $@ $<"
+ @$(CPP) $(CPPFLAGS) $< | $(PREPROC) $< charmap.txt -i | { $(CC1) $(CFLAGS) -o - -; echo -e ".text\n\t.align\t2, 0"; } | $(AS) $(ASFLAGS) -o $@ -
+else
@$(CPP) $(CPPFLAGS) $< -o $(GFLIB_BUILDDIR)/$*.i
@$(PREPROC) $(GFLIB_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(GFLIB_BUILDDIR)/$*.s
@echo -e ".text\n\t.align\t2, 0\n" >> $(GFLIB_BUILDDIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(GFLIB_BUILDDIR)/$*.s
+endif
ifeq ($(NODEP),1)
$(C_BUILDDIR)/%.o: c_asm_dep :=