diff --git a/src/modules/common_module_makefile.in b/src/modules/common_module_makefile.in index 305c1f610b39fe2b484738da73754727f54fe368..1d8995b723ab93e3c973f629b695106de8d81c62 100644 --- a/src/modules/common_module_makefile.in +++ b/src/modules/common_module_makefile.in @@ -1,5 +1,5 @@ # -# $Id: common_module_makefile.in,v 1.46 2006/11/23 04:37:16 bill Exp $ +# $Id: common_module_makefile.in,v 1.47 2007/02/10 23:44:02 bill Exp $ # # Contains stuff common to both dynamic_module_makefile and # static_module_makefile. @@ -41,7 +41,7 @@ $(MODULE_ARCHIVES) ThisIsAPhonyTargetBlaBlaBla: force ) || exit $$? .SUFFIXES: -.SUFFIXES: .c .o .cmod .protos .m .mmod +.SUFFIXES: .c .o .cmod .protos .m .mmod .cc .ccmod .cmod.c: $(BUILD_BASE)/precompile.sh-stamp $(TMP_BINDIR)/precompile.pike $(BUILD_BASE)/precompile.sh --cache precompile.pike >"$@" "$<" || { rm "$@"; exit 1; } @@ -49,6 +49,9 @@ $(MODULE_ARCHIVES) ThisIsAPhonyTargetBlaBlaBla: force .mmod.m: $(BUILD_BASE)/precompile.sh-stamp $(TMP_BINDIR)/precompile.pike $(BUILD_BASE)/precompile.sh --cache precompile.pike >"$@" "$<" || { rm "$@"; exit 1; } +.ccmod.cc: $(BUILD_BASE)/precompile.sh-stamp $(TMP_BINDIR)/precompile.pike + $(BUILD_BASE)/precompile.sh --cache precompile.pike >"$@" "$<" || { rm "$@"; exit 1; } + # GCC dumps core on some files @ OSF1 # This kluge should work around that... @@ -105,6 +108,33 @@ $(MODULE_ARCHIVES) ThisIsAPhonyTargetBlaBlaBla: force -DPMOD_PROTO=PMOD_PROTO -DPIKE_PRECOMPILER=1 "$<" || \ { rm "$@"; exit 1; } +.cc.o: + @echo "Compiling `echo '$<' | sed -e 's|^$(PIKE_SRC_DIR)/||'`" ; \ + rm -f $@.fail >/dev/null 2>&1; \ + if $(CC) $(PREFLAGS) $(CFLAGS) -c $< -o $@ ; then : ; else \ + status=$$?; \ + if test x"@noopt_retry@" = xyes ; then \ + echo "WARNING: Compiler failure! Trying without optimization!" >&2;\ + echo "$(CC) $(PREFLAGS) $(CFLAGS) -c $< -o $@" >$@.fail ;\ + if NO_ULIMIT=yes $(CC) $(PREFLAGS) $(NOOPTFLAGS) -c $< -o $@ ; then : ; else \ + status=$$?; \ + echo "Compilation command was:" >&2;\ + echo "$(CC) $(PREFLAGS) $(NOOPTFLAGS) -c $< -o $@" >&2 ;\ + exit $$status; \ + fi; \ + else \ + echo "Compilation command was:" >&2;\ + echo "$(CC) $(PREFLAGS) $(CFLAGS) -c $< -o $@" >&2 ;\ + exit $$status; \ + fi; \ + fi + +.cc.protos: $(BUILD_BASE)/precompile.sh-stamp + ./precompile.sh --cache fake_dynamic_load.pike >"$@" --cpp --protos \ + $(CPP) $(PREFLAGS) -DPMOD_EXPORT=PMOD_EXPORT \ + -DPMOD_PROTO=PMOD_PROTO -DPIKE_PRECOMPILER=1 "$<" || \ + { rm "$@"; exit 1; } + propagated_variables: make_variables: $(make_variables_in) config.status propagated_variables