diff --git a/config/rules.mk b/config/rules.mk index fe4c986378f2..10cf3d981b3f 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -985,7 +985,7 @@ else ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC)) $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) else -ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX)) +ifdef HOST_CPPSRCS $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS) else $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS) diff --git a/js/src/Makefile.in b/js/src/Makefile.in index 07b4cceadabf..0d439332248e 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -46,6 +46,7 @@ include $(DEPTH)/config/autoconf.mk MODULE = js LIBRARY_NAME = mozjs +LIB_IS_C_ONLY = 1 GRE_MODULE = 1 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) @@ -64,42 +65,42 @@ ifndef JS_STATIC_BUILD FORCE_SHARED_LIB = 1 endif -CPPSRCS = \ - jsapi.cpp \ - jsarena.cpp \ - jsarray.cpp \ - jsatom.cpp \ - jsbool.cpp \ - jscntxt.cpp \ - jsdate.cpp \ - jsdbgapi.cpp \ - jsdhash.cpp \ - jsdtoa.cpp \ - jsemit.cpp \ - jsexn.cpp \ - jsfun.cpp \ - jsgc.cpp \ - jshash.cpp \ - jsinterp.cpp \ - jsiter.cpp \ - jslock.cpp \ - jslog2.cpp \ - jslong.cpp \ - jsmath.cpp \ - jsnum.cpp \ - jsobj.cpp \ - jsopcode.cpp \ - jsparse.cpp \ - jsprf.cpp \ - jsregexp.cpp \ - jsscan.cpp \ - jsscope.cpp \ - jsscript.cpp \ - jsstr.cpp \ - jsutil.cpp \ - jsxdrapi.cpp \ - jsxml.cpp \ - prmjtime.cpp \ +CSRCS = \ + jsapi.c \ + jsarena.c \ + jsarray.c \ + jsatom.c \ + jsbool.c \ + jscntxt.c \ + jsdate.c \ + jsdbgapi.c \ + jsdhash.c \ + jsdtoa.c \ + jsemit.c \ + jsexn.c \ + jsfun.c \ + jsgc.c \ + jshash.c \ + jsinterp.c \ + jsiter.c \ + jslock.c \ + jslog2.c \ + jslong.c \ + jsmath.c \ + jsnum.c \ + jsobj.c \ + jsopcode.c \ + jsparse.c \ + jsprf.c \ + jsregexp.c \ + jsscan.c \ + jsscope.c \ + jsscript.c \ + jsstr.c \ + jsutil.c \ + jsxdrapi.c \ + jsxml.c \ + prmjtime.c \ $(NULL) EXPORTS = \ @@ -163,7 +164,7 @@ include $(topsrcdir)/config/config.mk EXTRA_DSO_LDOPTS += $(NSPR_LIBS) -# When using gcc the assembly is inlined in the C-file (see jslock.cpp) +# When using gcc the assembly is inlined in the C-file (see jslock.c) ifeq ($(OS_ARCH),SunOS) ifneq ($(OS_TEST),i86pc) ifndef GNU_CC @@ -194,7 +195,6 @@ JSJAVA_CFLAGS = \ HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX) GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX) -USE_HOST_CXX = 1 include $(topsrcdir)/config/rules.mk @@ -297,27 +297,27 @@ endif ifeq ($(OS_ARCH),IRIX) ifndef GNU_CC _COMPILE_CFLAGS = $(patsubst -O%,-O1,$(COMPILE_CFLAGS)) -jsapi.o jsxdrapi.o jsarena.o jsarray.o jsatom.o jsemit.o jsfun.o jsinterp.o jsregexp.o jsparse.o jsopcode.o jsscript.o: %.o: %.cpp Makefile.in +jsapi.o jsxdrapi.o jsarena.o jsarray.o jsatom.o jsemit.o jsfun.o jsinterp.o jsregexp.o jsparse.o jsopcode.o jsscript.o: %.o: %.c Makefile.in $(REPORT_BUILD) @$(MAKE_DEPS_AUTO) - $(CXX) -o $@ -c $(_COMPILE_CFLAGS) $< + $(CC) -o $@ -c $(_COMPILE_CFLAGS) $< endif endif # An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result. # This suppresses optimization for this single compilation unit. ifeq ($(OS_ARCH),AIX) -jsatom.o: jsatom.cpp Makefile.in +jsatom.o: jsatom.c Makefile.in $(REPORT_BUILD) @$(MAKE_DEPS_AUTO) - $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< -jsdtoa.o: jsdtoa.cpp Makefile.in + $(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< +jsdtoa.o: jsdtoa.c Makefile.in $(REPORT_BUILD) @$(MAKE_DEPS_AUTO) - $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< + $(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< endif -jsopcode.h jsopcode.cpp: jsopcode.tbl +jsopcode.h jsopcode.c: jsopcode.tbl ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH))) jsautocfg.h: @@ -338,8 +338,8 @@ endif # Needs to be built with the host compiler but needs to include # the mdcpucfg for the target so it needs the appropriate target defines ifdef HOST_NSPR_MDCPUCFG -HOST_CXX := $(HOST_CXX) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG) -HOST_CXXFLAGS := $(patsubst -DXP_%,,$(HOST_CXXFLAGS)) +HOST_CC := $(HOST_CC) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG) +HOST_CFLAGS := $(patsubst -DXP_%,,$(HOST_CFLAGS)) endif ifdef CROSS_COMPILE @@ -363,19 +363,19 @@ endif ifeq ($(OS_ARCH),QNX) ifneq ($(OS_TARGET),NTO) # QNX's compiler apparently can't build a binary directly from a source file. -jscpucfg.o: jscpucfg.cpp Makefile.in - $(HOST_CXX) $(HOST_CXXFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $< +jscpucfg.o: jscpucfg.c Makefile.in + $(HOST_CC) $(HOST_CFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $< jscpucfg: jscpucfg.o - $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $< + $(HOST_CC) $(HOST_CFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $< endif else ifeq ($(OS_ARCH),WINCE) jscpucfg$(HOST_BIN_SUFFIX): echo no need to build jscpucfg $< else -jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in - $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(OUTOPTION)$@ $< +jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.c Makefile.in + $(HOST_CC) $(HOST_CFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(OUTOPTION)$@ $< endif endif diff --git a/js/src/Makefile.ref b/js/src/Makefile.ref index 295a65c22f94..91af44d7fdc5 100644 --- a/js/src/Makefile.ref +++ b/js/src/Makefile.ref @@ -92,7 +92,7 @@ endif # Prevent floating point errors caused by VC++ optimizations ifeq ($(OS_ARCH),WINNT) -_MSC_VER = $(shell $(CXX) 2>&1 | sed -n 's/.*Compiler Version \([0-9]*\)\.\([0-9]*\).*/\1\2/p') +_MSC_VER = $(shell $(CC) 2>&1 | sed -n 's/.*Compiler Version \([0-9]*\)\.\([0-9]*\).*/\1\2/p') ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER))) CFLAGS += -Op else @@ -198,42 +198,42 @@ OTHER_HFILES += $(OBJDIR)/jsautokw.h HFILES = $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES) -JS_CPPFILES = \ - jsapi.cpp \ - jsarena.cpp \ - jsarray.cpp \ - jsatom.cpp \ - jsbool.cpp \ - jscntxt.cpp \ - jsdate.cpp \ - jsdbgapi.cpp \ - jsdhash.cpp \ - jsdtoa.cpp \ - jsemit.cpp \ - jsexn.cpp \ - jsfun.cpp \ - jsgc.cpp \ - jshash.cpp \ - jsinterp.cpp \ - jsiter.cpp \ - jslock.cpp \ - jslog2.cpp \ - jslong.cpp \ - jsmath.cpp \ - jsnum.cpp \ - jsobj.cpp \ - jsopcode.cpp \ - jsparse.cpp \ - jsprf.cpp \ - jsregexp.cpp \ - jsscan.cpp \ - jsscope.cpp \ - jsscript.cpp \ - jsstr.cpp \ - jsutil.cpp \ - jsxdrapi.cpp \ - jsxml.cpp \ - prmjtime.cpp \ +JS_CFILES = \ + jsapi.c \ + jsarena.c \ + jsarray.c \ + jsatom.c \ + jsbool.c \ + jscntxt.c \ + jsdate.c \ + jsdbgapi.c \ + jsdhash.c \ + jsdtoa.c \ + jsemit.c \ + jsexn.c \ + jsfun.c \ + jsgc.c \ + jshash.c \ + jsinterp.c \ + jsiter.c \ + jslock.c \ + jslog2.c \ + jslong.c \ + jsmath.c \ + jsnum.c \ + jsobj.c \ + jsopcode.c \ + jsparse.c \ + jsprf.c \ + jsregexp.c \ + jsscan.c \ + jsscope.c \ + jsscript.c \ + jsstr.c \ + jsutil.c \ + jsxdrapi.c \ + jsxml.c \ + prmjtime.c \ $(NULL) ifdef JS_LIVECONNECT @@ -241,13 +241,13 @@ DIRS += liveconnect endif ifdef JS_HAS_FILE_OBJECT -JS_CPPFILES += jsfile.cpp +JS_CFILES += jsfile.c JS_HFILES += jsfile.h endif -LIB_CPPFILES = $(JS_CPPFILES) +LIB_CFILES = $(JS_CFILES) LIB_ASFILES := $(wildcard *_$(OS_ARCH).s) -PROG_CPPFILES = js.cpp +PROG_CFILES = js.c ifdef USE_MSVC LIBRARY = $(OBJDIR)/js32.lib @@ -276,28 +276,28 @@ GARBAGE += $(OBJDIR)/jskwgen.$(OBJ_SUFFIX) $(OBJDIR)/jsscan.$(OBJ_SUFFIX): $(OBJDIR)/jsautokw.h jskeyword.tbl -$(OBJDIR)/jskwgen.$(OBJ_SUFFIX): jskwgen.cpp jskeyword.tbl +$(OBJDIR)/jskwgen.$(OBJ_SUFFIX): jskwgen.c jskeyword.tbl $(OBJDIR)/jsautokw.h: $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX) jskeyword.tbl $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX) $@ ifdef USE_MSVC -$(OBJDIR)/jskwgen.obj: jskwgen.cpp jskeyword.tbl +$(OBJDIR)/jskwgen.obj: jskwgen.c jskeyword.tbl @$(MAKE_OBJDIR) - $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $< + $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $< $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX): $(OBJDIR)/jskwgen.$(OBJ_SUFFIX) link.exe -out:"$@" $(EXE_LINK_FLAGS) $^ else -$(OBJDIR)/jskwgen.o: jskwgen.cpp jskeyword.tbl +$(OBJDIR)/jskwgen.o: jskwgen.c jskeyword.tbl @$(MAKE_OBJDIR) - $(CXX) -o $@ -c $(CFLAGS) $< + $(CC) -o $@ -c $(CFLAGS) $< $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX): $(OBJDIR)/jskwgen.$(OBJ_SUFFIX) - $(CXX) -o $@ $(CFLAGS) $(LDFLAGS) $^ + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ endif @@ -310,24 +310,24 @@ $(PROGRAM): $(PROG_OBJS) $(LIBRARY) link.exe -out:"$@" $(EXE_LINK_FLAGS) $^ else $(PROGRAM): $(PROG_OBJS) $(LIBRARY) - $(CXX) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \ + $(CC) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \ $(PROG_LIBS) endif $(PROGRAM).pure: $(PROG_OBJS) $(LIBRARY) purify $(PUREFLAGS) \ - $(CXX) -o $@ $(PURE_OS_CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) \ + $(CC) -o $@ $(PURE_OS_CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) \ $(OTHER_LIBS) $(PROG_LIBS) ifndef PREBUILT_CPUCFG -$(HFILES) $(CPPFILES): $(OBJDIR)/jsautocfg.h +$(HFILES) $(CFILES): $(OBJDIR)/jsautocfg.h $(OBJDIR)/jsautocfg.h: $(OBJDIR)/jscpucfg rm -f $@ $(OBJDIR)/jscpucfg > $@ $(OBJDIR)/jscpucfg: $(OBJDIR)/jscpucfg.o - $(CXX) -o $@ $(OBJDIR)/jscpucfg.o + $(CC) -o $@ $(OBJDIR)/jscpucfg.o # Add to TARGETS for clobber rule TARGETS += $(OBJDIR)/jsautocfg.h $(OBJDIR)/jscpucfg \ @@ -337,7 +337,7 @@ endif # # Hardwire dependencies on jsopcode.tbl # -jsopcode.h jsopcode.cpp: jsopcode.tbl +jsopcode.h jsopcode.c: jsopcode.tbl -include $(DEPENDENCIES) @@ -345,5 +345,5 @@ TARNAME = jsref.tar TARFILES = files `cat files` SUFFIXES: .i -%.i: %.cpp - $(CXX) -C -E $(CFLAGS) $< > $*.i +%.i: %.c + $(CC) -C -E $(CFLAGS) $< > $*.i diff --git a/js/src/config/Darwin.mk b/js/src/config/Darwin.mk index 7faf7a86174b..23b503e376fd 100644 --- a/js/src/config/Darwin.mk +++ b/js/src/config/Darwin.mk @@ -49,7 +49,7 @@ CFLAGS += -Wall -Wno-format OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN RANLIB = ranlib -MKSHLIB = $(CCC) -dynamiclib $(XMKSHLIBOPTS) -framework System +MKSHLIB = $(CC) -dynamiclib $(XMKSHLIBOPTS) -framework System SO_SUFFIX = dylib diff --git a/js/src/js.cpp b/js/src/js.c similarity index 100% rename from js/src/js.cpp rename to js/src/js.c diff --git a/js/src/jsapi.cpp b/js/src/jsapi.c similarity index 100% rename from js/src/jsapi.cpp rename to js/src/jsapi.c diff --git a/js/src/jsarena.cpp b/js/src/jsarena.c similarity index 100% rename from js/src/jsarena.cpp rename to js/src/jsarena.c diff --git a/js/src/jsarray.cpp b/js/src/jsarray.c similarity index 100% rename from js/src/jsarray.cpp rename to js/src/jsarray.c diff --git a/js/src/jsatom.cpp b/js/src/jsatom.c similarity index 100% rename from js/src/jsatom.cpp rename to js/src/jsatom.c diff --git a/js/src/jsbool.cpp b/js/src/jsbool.c similarity index 100% rename from js/src/jsbool.cpp rename to js/src/jsbool.c diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.c similarity index 100% rename from js/src/jscntxt.cpp rename to js/src/jscntxt.c diff --git a/js/src/jscpucfg.cpp b/js/src/jscpucfg.c similarity index 100% rename from js/src/jscpucfg.cpp rename to js/src/jscpucfg.c diff --git a/js/src/jsdate.cpp b/js/src/jsdate.c similarity index 100% rename from js/src/jsdate.cpp rename to js/src/jsdate.c diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.c similarity index 100% rename from js/src/jsdbgapi.cpp rename to js/src/jsdbgapi.c diff --git a/js/src/jsdhash.cpp b/js/src/jsdhash.c similarity index 100% rename from js/src/jsdhash.cpp rename to js/src/jsdhash.c diff --git a/js/src/jsdtoa.cpp b/js/src/jsdtoa.c similarity index 100% rename from js/src/jsdtoa.cpp rename to js/src/jsdtoa.c diff --git a/js/src/jsemit.cpp b/js/src/jsemit.c similarity index 100% rename from js/src/jsemit.cpp rename to js/src/jsemit.c diff --git a/js/src/jsexn.cpp b/js/src/jsexn.c similarity index 100% rename from js/src/jsexn.cpp rename to js/src/jsexn.c diff --git a/js/src/jsfile.cpp b/js/src/jsfile.c similarity index 100% rename from js/src/jsfile.cpp rename to js/src/jsfile.c diff --git a/js/src/jsfun.cpp b/js/src/jsfun.c similarity index 100% rename from js/src/jsfun.cpp rename to js/src/jsfun.c diff --git a/js/src/jsgc.cpp b/js/src/jsgc.c similarity index 100% rename from js/src/jsgc.cpp rename to js/src/jsgc.c diff --git a/js/src/jshash.cpp b/js/src/jshash.c similarity index 100% rename from js/src/jshash.cpp rename to js/src/jshash.c diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.c similarity index 100% rename from js/src/jsinterp.cpp rename to js/src/jsinterp.c diff --git a/js/src/jsiter.cpp b/js/src/jsiter.c similarity index 100% rename from js/src/jsiter.cpp rename to js/src/jsiter.c diff --git a/js/src/jskwgen.cpp b/js/src/jskwgen.c similarity index 100% rename from js/src/jskwgen.cpp rename to js/src/jskwgen.c diff --git a/js/src/jslock.cpp b/js/src/jslock.c similarity index 100% rename from js/src/jslock.cpp rename to js/src/jslock.c diff --git a/js/src/jslog2.cpp b/js/src/jslog2.c similarity index 100% rename from js/src/jslog2.cpp rename to js/src/jslog2.c diff --git a/js/src/jslong.cpp b/js/src/jslong.c similarity index 100% rename from js/src/jslong.cpp rename to js/src/jslong.c diff --git a/js/src/jsmath.cpp b/js/src/jsmath.c similarity index 100% rename from js/src/jsmath.cpp rename to js/src/jsmath.c diff --git a/js/src/jsnum.cpp b/js/src/jsnum.c similarity index 100% rename from js/src/jsnum.cpp rename to js/src/jsnum.c diff --git a/js/src/jsobj.cpp b/js/src/jsobj.c similarity index 100% rename from js/src/jsobj.cpp rename to js/src/jsobj.c diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.c similarity index 100% rename from js/src/jsopcode.cpp rename to js/src/jsopcode.c diff --git a/js/src/jsparse.cpp b/js/src/jsparse.c similarity index 100% rename from js/src/jsparse.cpp rename to js/src/jsparse.c diff --git a/js/src/jsprf.cpp b/js/src/jsprf.c similarity index 100% rename from js/src/jsprf.cpp rename to js/src/jsprf.c diff --git a/js/src/jsregexp.cpp b/js/src/jsregexp.c similarity index 100% rename from js/src/jsregexp.cpp rename to js/src/jsregexp.c diff --git a/js/src/jsscan.cpp b/js/src/jsscan.c similarity index 100% rename from js/src/jsscan.cpp rename to js/src/jsscan.c diff --git a/js/src/jsscope.cpp b/js/src/jsscope.c similarity index 100% rename from js/src/jsscope.cpp rename to js/src/jsscope.c diff --git a/js/src/jsscript.cpp b/js/src/jsscript.c similarity index 100% rename from js/src/jsscript.cpp rename to js/src/jsscript.c diff --git a/js/src/jsstr.cpp b/js/src/jsstr.c similarity index 100% rename from js/src/jsstr.cpp rename to js/src/jsstr.c diff --git a/js/src/jsutil.cpp b/js/src/jsutil.c similarity index 100% rename from js/src/jsutil.cpp rename to js/src/jsutil.c diff --git a/js/src/jsxdrapi.cpp b/js/src/jsxdrapi.c similarity index 100% rename from js/src/jsxdrapi.cpp rename to js/src/jsxdrapi.c diff --git a/js/src/jsxml.cpp b/js/src/jsxml.c similarity index 100% rename from js/src/jsxml.cpp rename to js/src/jsxml.c diff --git a/js/src/prmjtime.cpp b/js/src/prmjtime.c similarity index 100% rename from js/src/prmjtime.cpp rename to js/src/prmjtime.c diff --git a/js/src/rules.mk b/js/src/rules.mk index 631d64b6a0de..8d484db9a5f1 100644 --- a/js/src/rules.mk +++ b/js/src/rules.mk @@ -43,15 +43,15 @@ # ifdef USE_MSVC -LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CPPFILES:.cpp=.obj)) -PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CPPFILES:.cpp=.obj)) +LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CFILES:.c=.obj)) +PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CFILES:.c=.obj)) else -LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CPPFILES:.cpp=.o)) +LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CFILES:.c=.o)) LIB_OBJS += $(addprefix $(OBJDIR)/, $(LIB_ASFILES:.s=.o)) -PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CPPFILES:.cpp=.o)) +PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CFILES:.c=.o)) endif -CPPFILES = $(LIB_CPPFILES) $(PROG_CPPFILES) +CFILES = $(LIB_CFILES) $(PROG_CFILES) OBJS = $(LIB_OBJS) $(PROG_OBJS) ifdef USE_MSVC @@ -68,36 +68,36 @@ ifneq "$(strip $(TARGETS))" "" endif +$(LOOP_OVER_DIRS) -$(OBJDIR)/%: %.cpp +$(OBJDIR)/%: %.c @$(MAKE_OBJDIR) - $(CXX) -o $@ $(CFLAGS) $*.cpp $(LDFLAGS) + $(CC) -o $@ $(CFLAGS) $*.c $(LDFLAGS) # This rule must come before the rule with no dep on header -$(OBJDIR)/%.o: %.cpp %.h +$(OBJDIR)/%.o: %.c %.h @$(MAKE_OBJDIR) - $(CXX) -o $@ -c $(CFLAGS) $*.cpp + $(CC) -o $@ -c $(CFLAGS) $*.c -$(OBJDIR)/%.o: %.cpp +$(OBJDIR)/%.o: %.c @$(MAKE_OBJDIR) - $(CXX) -o $@ -c $(CFLAGS) $*.cpp + $(CC) -o $@ -c $(CFLAGS) $*.c $(OBJDIR)/%.o: %.s @$(MAKE_OBJDIR) $(AS) -o $@ $(ASFLAGS) $*.s # This rule must come before rule with no dep on header -$(OBJDIR)/%.obj: %.cpp %.h +$(OBJDIR)/%.obj: %.c %.h @$(MAKE_OBJDIR) - $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.cpp + $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.c -$(OBJDIR)/%.obj: %.cpp +$(OBJDIR)/%.obj: %.c @$(MAKE_OBJDIR) - $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.cpp + $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.c -$(OBJDIR)/js.obj: js.cpp +$(OBJDIR)/js.obj: js.c @$(MAKE_OBJDIR) - $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $< + $(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $< ifeq ($(OS_ARCH),OS2) $(LIBRARY): $(LIB_OBJS) @@ -185,7 +185,7 @@ clobber: @cd fdlibm; $(MAKE) -f Makefile.ref clobber depend: - gcc -MM $(CFLAGS) $(LIB_CPPFILES) + gcc -MM $(CFLAGS) $(LIB_CFILES) tar: tar cvf $(TARNAME) $(TARFILES)