aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.moddir_rules3
-rw-r--r--Makefile.rules17
-rw-r--r--agi/Makefile3
-rw-r--r--utils/Makefile2
4 files changed, 10 insertions, 15 deletions
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index c2985fd78..1db15ecb1 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -111,7 +111,7 @@ modules.link:
clean::
rm -f *.so *.o *.oo *.eo *.i *.ii
- rm -f .*.o.d .*.oo.d
+ rm -f .*.d
rm -f *.s *.i
rm -f modules.link
@@ -124,7 +124,6 @@ uninstall::
dist-clean::
rm -f .*.moduleinfo .moduleinfo
rm -f .*.makeopts .makeopts
- rm -f .*.d
.%.moduleinfo: %.c
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
diff --git a/Makefile.rules b/Makefile.rules
index 92fca37c9..db44a876b 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -19,6 +19,11 @@
.PHONY: dist-clean
+# If 'make' decides to create intermediate files to satisfy a build requirement
+# (like producing a .i from a .c), we want to keep them, so tell make to keep
+# all intermediate files
+.SECONDARY:
+
# extra cflags to build dependencies. Recursively expanded.
MAKE_DEPS=-MD -MT $@ -MF .$(subst /,_,$@).d -MP
@@ -74,13 +79,9 @@ ifeq ($(COMPILE_DOUBLE),yes)
endif
$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
+ifneq ($(COMPILE_DOUBLE),yes)
%.o: %.c
$(ECHO_PREFIX) echo " [CC] $< -> $@"
-ifeq ($(COMPILE_DOUBLE),yes)
- $(CMD_PREFIX) $(CC) -o $(@:%.o=%.i) -E $< $(CC_CFLAGS) $(MAKE_DEPS)
- $(CMD_PREFIX) $(CC) -o /dev/null -c $(@:%.o=%.i) $(CC_CFLAGS) $(OPTIMIZE)
- $(CMD_PREFIX) $(CC) -o $@ -c $(@:%.o=%.i) $(CC_CFLAGS)
-else
$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS) $(MAKE_DEPS)
endif
@@ -95,13 +96,9 @@ ifeq ($(COMPILE_DOUBLE),yes)
endif
$(CMD_PREFIX) $(CXX) -o $@ -c $< $(CXX_CFLAGS)
+ifneq ($(COMPILE_DOUBLE),yes)
%.oo: %.cc
$(ECHO_PREFIX) echo " [CXX] $< -> $@"
-ifeq ($(COMPILE_DOUBLE),yes)
- $(CMD_PREFIX) $(CXX) -o $(@:%.oo=%.ii) -E $< $(CXX_CFLAGS) $(MAKE_DEPS)
- $(CMD_PREFIX) $(CXX) -o /dev/null -c $(@:%.oo=%.ii) $(CXX_CFLAGS) $(MAKE_DEPS) $(OPTIMIZE)
- $(CMD_PREFIX) $(CXX) -o $@ -c $(@:%.oo=%.ii) $(CXX_CFLAGS) $(MAKE_DEPS)
-else
$(CMD_PREFIX) $(CXX) -o $@ -c $< $(CXX_CFLAGS) $(MAKE_DEPS)
endif
diff --git a/agi/Makefile b/agi/Makefile
index d580a1632..e8e57a9b9 100644
--- a/agi/Makefile
+++ b/agi/Makefile
@@ -48,8 +48,7 @@ uninstall:
clean:
rm -f *.so *.o look eagi-test eagi-sphinx-test
- rm -f .*.o.d .*.oo.d
- rm -f *.s *.i
+ rm -f .*.d *.s *.i
rm -f strcompat.c
ifneq ($(wildcard .*.d),)
diff --git a/utils/Makefile b/utils/Makefile
index f058fea28..d705c40ed 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -73,7 +73,7 @@ uninstall:
clean:
rm -f *.o $(ALL_UTILS) check_expr
- rm -f .*.o.d .*.oo.d
+ rm -f .*.d
rm -f *.s *.i
rm -f md5.c strcompat.c ast_expr2.c ast_expr2f.c pbx_ael.c pval.c hashtab.c
rm -f aelparse.c aelbison.c conf2ael