Return to building spidermonkey as C++, because we believe we found the cause of the perf regression elsewhere (non-code).

--HG--
rename : js/src/js.c => js/src/js.cpp
rename : js/src/jsapi.c => js/src/jsapi.cpp
rename : js/src/jsarena.c => js/src/jsarena.cpp
rename : js/src/jsarray.c => js/src/jsarray.cpp
rename : js/src/jsatom.c => js/src/jsatom.cpp
rename : js/src/jsbool.c => js/src/jsbool.cpp
rename : js/src/jscntxt.c => js/src/jscntxt.cpp
rename : js/src/jscpucfg.c => js/src/jscpucfg.cpp
rename : js/src/jsdate.c => js/src/jsdate.cpp
rename : js/src/jsdbgapi.c => js/src/jsdbgapi.cpp
rename : js/src/jsdhash.c => js/src/jsdhash.cpp
rename : js/src/jsdtoa.c => js/src/jsdtoa.cpp
rename : js/src/jsemit.c => js/src/jsemit.cpp
rename : js/src/jsexn.c => js/src/jsexn.cpp
rename : js/src/jsfile.c => js/src/jsfile.cpp
rename : js/src/jsfun.c => js/src/jsfun.cpp
rename : js/src/jsgc.c => js/src/jsgc.cpp
rename : js/src/jshash.c => js/src/jshash.cpp
rename : js/src/jsinterp.c => js/src/jsinterp.cpp
rename : js/src/jsinvoke.c => js/src/jsinvoke.cpp
rename : js/src/jsiter.c => js/src/jsiter.cpp
rename : js/src/jskwgen.c => js/src/jskwgen.cpp
rename : js/src/jslock.c => js/src/jslock.cpp
rename : js/src/jslog2.c => js/src/jslog2.cpp
rename : js/src/jslong.c => js/src/jslong.cpp
rename : js/src/jsmath.c => js/src/jsmath.cpp
rename : js/src/jsnum.c => js/src/jsnum.cpp
rename : js/src/jsobj.c => js/src/jsobj.cpp
rename : js/src/jsopcode.c => js/src/jsopcode.cpp
rename : js/src/jsparse.c => js/src/jsparse.cpp
rename : js/src/jsprf.c => js/src/jsprf.cpp
rename : js/src/jsregexp.c => js/src/jsregexp.cpp
rename : js/src/jsscan.c => js/src/jsscan.cpp
rename : js/src/jsscope.c => js/src/jsscope.cpp
rename : js/src/jsscript.c => js/src/jsscript.cpp
rename : js/src/jsstr.c => js/src/jsstr.cpp
rename : js/src/jsutil.c => js/src/jsutil.cpp
rename : js/src/jsxdrapi.c => js/src/jsxdrapi.cpp
rename : js/src/jsxml.c => js/src/jsxml.cpp
rename : js/src/prmjtime.c => js/src/prmjtime.cpp
This commit is contained in:
Benjamin Smedberg 2008-05-27 16:58:12 -04:00
parent 5068d70767
commit 93076abf3d
45 changed files with 135 additions and 135 deletions

View File

@ -968,7 +968,7 @@ else
ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC)) ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else else
ifdef HOST_CPPSRCS ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS) $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else else
$(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS) $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)

View File

@ -46,7 +46,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = js MODULE = js
LIBRARY_NAME = mozjs LIBRARY_NAME = mozjs
LIB_IS_C_ONLY = 1
GRE_MODULE = 1 GRE_MODULE = 1
ifdef GNU_CC ifdef GNU_CC
@ -88,43 +87,43 @@ ifndef JS_STATIC_BUILD
FORCE_SHARED_LIB = 1 FORCE_SHARED_LIB = 1
endif endif
CSRCS = \ CPPSRCS = \
jsapi.c \ jsapi.cpp \
jsarena.c \ jsarena.cpp \
jsarray.c \ jsarray.cpp \
jsatom.c \ jsatom.cpp \
jsbool.c \ jsbool.cpp \
jscntxt.c \ jscntxt.cpp \
jsdate.c \ jsdate.cpp \
jsdbgapi.c \ jsdbgapi.cpp \
jsdhash.c \ jsdhash.cpp \
jsdtoa.c \ jsdtoa.cpp \
jsemit.c \ jsemit.cpp \
jsexn.c \ jsexn.cpp \
jsfun.c \ jsfun.cpp \
jsgc.c \ jsgc.cpp \
jshash.c \ jshash.cpp \
jsinterp.c \ jsinterp.cpp \
jsinvoke.c \ jsinvoke.cpp \
jsiter.c \ jsiter.cpp \
jslock.c \ jslock.cpp \
jslog2.c \ jslog2.cpp \
jslong.c \ jslong.cpp \
jsmath.c \ jsmath.cpp \
jsnum.c \ jsnum.cpp \
jsobj.c \ jsobj.cpp \
jsopcode.c \ jsopcode.cpp \
jsparse.c \ jsparse.cpp \
jsprf.c \ jsprf.cpp \
jsregexp.c \ jsregexp.cpp \
jsscan.c \ jsscan.cpp \
jsscope.c \ jsscope.cpp \
jsscript.c \ jsscript.cpp \
jsstr.c \ jsstr.cpp \
jsutil.c \ jsutil.cpp \
jsxdrapi.c \ jsxdrapi.cpp \
jsxml.c \ jsxml.cpp \
prmjtime.c \ prmjtime.cpp \
$(NULL) $(NULL)
ifdef HAVE_DTRACE ifdef HAVE_DTRACE
@ -206,7 +205,7 @@ include $(topsrcdir)/config/config.mk
EXTRA_DSO_LDOPTS += $(NSPR_LIBS) EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
# When using gcc the assembly is inlined in the C-file (see jslock.c) # When using gcc the assembly is inlined in the C-file (see jslock.cpp)
ifeq ($(OS_ARCH),SunOS) ifeq ($(OS_ARCH),SunOS)
ifneq (86,$(findstring 86,$(OS_TEST))) ifneq (86,$(findstring 86,$(OS_TEST)))
ifndef GNU_CC ifndef GNU_CC
@ -237,6 +236,7 @@ JSJAVA_CFLAGS = \
HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX) HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX)
GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX) GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX)
USE_HOST_CXX = 1
ifdef HAVE_DTRACE ifdef HAVE_DTRACE
ifneq ($(OS_ARCH),Darwin) ifneq ($(OS_ARCH),Darwin)
@ -357,27 +357,27 @@ endif
ifeq ($(OS_ARCH),IRIX) ifeq ($(OS_ARCH),IRIX)
ifndef GNU_CC ifndef GNU_CC
_COMPILE_CFLAGS = $(patsubst -O%,-O1,$(COMPILE_CFLAGS)) _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: %.c 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: %.cpp Makefile.in
$(REPORT_BUILD) $(REPORT_BUILD)
@$(MAKE_DEPS_AUTO_CC) @$(MAKE_DEPS_AUTO_CXX)
$(CC) -o $@ -c $(_COMPILE_CFLAGS) $< $(CXX) -o $@ -c $(_COMPILE_CFLAGS) $<
endif endif
endif endif
# An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result. # An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
# This suppresses optimization for this single compilation unit. # This suppresses optimization for this single compilation unit.
ifeq ($(OS_ARCH),AIX) ifeq ($(OS_ARCH),AIX)
jsatom.o: jsatom.c Makefile.in jsatom.o: jsatom.cpp Makefile.in
$(REPORT_BUILD) $(REPORT_BUILD)
@$(MAKE_DEPS_AUTO_CC) @$(MAKE_DEPS_AUTO_CXX)
$(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
jsdtoa.o: jsdtoa.c Makefile.in jsdtoa.o: jsdtoa.cpp Makefile.in
$(REPORT_BUILD) $(REPORT_BUILD)
@$(MAKE_DEPS_AUTO_CC) @$(MAKE_DEPS_AUTO_CXX)
$(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
endif endif
jsopcode.h jsopcode.c: jsopcode.tbl jsopcode.h jsopcode.cpp: jsopcode.tbl
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH))) ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
jsautocfg.h: jsautocfg.h:
@ -398,8 +398,8 @@ endif
# Needs to be built with the host compiler but needs to include # Needs to be built with the host compiler but needs to include
# the mdcpucfg for the target so it needs the appropriate target defines # the mdcpucfg for the target so it needs the appropriate target defines
ifdef HOST_NSPR_MDCPUCFG ifdef HOST_NSPR_MDCPUCFG
HOST_CC := $(HOST_CC) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG) HOST_CXX := $(HOST_CXX) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG)
HOST_CFLAGS := $(patsubst -DXP_%,,$(HOST_CFLAGS)) HOST_CXXFLAGS := $(patsubst -DXP_%,,$(HOST_CXXFLAGS))
endif endif
ifdef CROSS_COMPILE ifdef CROSS_COMPILE
@ -423,19 +423,19 @@ endif
ifeq ($(OS_ARCH),QNX) ifeq ($(OS_ARCH),QNX)
ifneq ($(OS_TARGET),NTO) ifneq ($(OS_TARGET),NTO)
# QNX's compiler apparently can't build a binary directly from a source file. # QNX's compiler apparently can't build a binary directly from a source file.
jscpucfg.o: jscpucfg.c Makefile.in jscpucfg.o: jscpucfg.cpp Makefile.in
$(HOST_CC) $(HOST_CFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $< $(HOST_CXX) $(HOST_CXXFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $<
jscpucfg: jscpucfg.o jscpucfg: jscpucfg.o
$(HOST_CC) $(HOST_CFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $< $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $<
endif endif
else else
ifeq ($(OS_ARCH),WINCE) ifeq ($(OS_ARCH),WINCE)
jscpucfg$(HOST_BIN_SUFFIX): jscpucfg$(HOST_BIN_SUFFIX):
echo no need to build jscpucfg $< echo no need to build jscpucfg $<
else else
jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.c Makefile.in jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
$(HOST_CC) $(HOST_CFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(OUTOPTION)$@ $< $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(OUTOPTION)$@ $<
endif endif
endif endif

View File

@ -100,7 +100,7 @@ endif
# Prevent floating point errors caused by VC++ optimizations # Prevent floating point errors caused by VC++ optimizations
ifeq ($(OS_ARCH),WINNT) ifeq ($(OS_ARCH),WINNT)
_MSC_VER = $(shell $(CC) 2>&1 | sed -n 's/.*Compiler Version \([0-9]*\)\.\([0-9]*\).*/\1\2/p') _MSC_VER = $(shell $(CXX) 2>&1 | sed -n 's/.*Compiler Version \([0-9]*\)\.\([0-9]*\).*/\1\2/p')
ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER))) ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
CFLAGS += -Op CFLAGS += -Op
else else
@ -205,43 +205,43 @@ OTHER_HFILES += $(OBJDIR)/jsautokw.h
HFILES = $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES) HFILES = $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES)
JS_CFILES = \ JS_CPPFILES = \
jsapi.c \ jsapi.cpp \
jsarena.c \ jsarena.cpp \
jsarray.c \ jsarray.cpp \
jsatom.c \ jsatom.cpp \
jsbool.c \ jsbool.cpp \
jscntxt.c \ jscntxt.cpp \
jsdate.c \ jsdate.cpp \
jsdbgapi.c \ jsdbgapi.cpp \
jsdhash.c \ jsdhash.cpp \
jsdtoa.c \ jsdtoa.cpp \
jsemit.c \ jsemit.cpp \
jsexn.c \ jsexn.cpp \
jsfun.c \ jsfun.cpp \
jsgc.c \ jsgc.cpp \
jshash.c \ jshash.cpp \
jsinterp.c \ jsinterp.cpp \
jsinvoke.c \ jsinvoke.cpp \
jsiter.c \ jsiter.cpp \
jslock.c \ jslock.cpp \
jslog2.c \ jslog2.cpp \
jslong.c \ jslong.cpp \
jsmath.c \ jsmath.cpp \
jsnum.c \ jsnum.cpp \
jsobj.c \ jsobj.cpp \
jsopcode.c \ jsopcode.cpp \
jsparse.c \ jsparse.cpp \
jsprf.c \ jsprf.cpp \
jsregexp.c \ jsregexp.cpp \
jsscan.c \ jsscan.cpp \
jsscope.c \ jsscope.cpp \
jsscript.c \ jsscript.cpp \
jsstr.c \ jsstr.cpp \
jsutil.c \ jsutil.cpp \
jsxdrapi.c \ jsxdrapi.cpp \
jsxml.c \ jsxml.cpp \
prmjtime.c \ prmjtime.cpp \
$(NULL) $(NULL)
ifdef JS_LIVECONNECT ifdef JS_LIVECONNECT
@ -249,13 +249,13 @@ DIRS += liveconnect
endif endif
ifdef JS_HAS_FILE_OBJECT ifdef JS_HAS_FILE_OBJECT
JS_CFILES += jsfile.c JS_CPPFILES += jsfile.cpp
JS_HFILES += jsfile.h JS_HFILES += jsfile.h
endif endif
LIB_CFILES = $(JS_CFILES) LIB_CPPFILES = $(JS_CPPFILES)
LIB_ASFILES := $(wildcard *_$(OS_ARCH).s) LIB_ASFILES := $(wildcard *_$(OS_ARCH).s)
PROG_CFILES = js.c PROG_CPPFILES = js.cpp
ifdef USE_MSVC ifdef USE_MSVC
LIBRARY = $(OBJDIR)/js32.lib LIBRARY = $(OBJDIR)/js32.lib
@ -284,28 +284,28 @@ GARBAGE += $(OBJDIR)/jskwgen.$(OBJ_SUFFIX)
$(OBJDIR)/jsscan.$(OBJ_SUFFIX): $(OBJDIR)/jsautokw.h jskeyword.tbl $(OBJDIR)/jsscan.$(OBJ_SUFFIX): $(OBJDIR)/jsautokw.h jskeyword.tbl
$(OBJDIR)/jskwgen.$(OBJ_SUFFIX): jskwgen.c jskeyword.tbl $(OBJDIR)/jskwgen.$(OBJ_SUFFIX): jskwgen.cpp jskeyword.tbl
$(OBJDIR)/jsautokw.h: $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX) jskeyword.tbl $(OBJDIR)/jsautokw.h: $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX) jskeyword.tbl
$(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX) $@ $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX) $@
ifdef USE_MSVC ifdef USE_MSVC
$(OBJDIR)/jskwgen.obj: jskwgen.c jskeyword.tbl $(OBJDIR)/jskwgen.obj: jskwgen.cpp jskeyword.tbl
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $< $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $<
$(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX): $(OBJDIR)/jskwgen.$(OBJ_SUFFIX) $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX): $(OBJDIR)/jskwgen.$(OBJ_SUFFIX)
link.exe -out:"$@" $(EXE_LINK_FLAGS) $^ link.exe -out:"$@" $(EXE_LINK_FLAGS) $^
else else
$(OBJDIR)/jskwgen.o: jskwgen.c jskeyword.tbl $(OBJDIR)/jskwgen.o: jskwgen.cpp jskeyword.tbl
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -o $@ -c $(CFLAGS) $< $(CXX) -o $@ -c $(CFLAGS) $<
$(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX): $(OBJDIR)/jskwgen.$(OBJ_SUFFIX) $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX): $(OBJDIR)/jskwgen.$(OBJ_SUFFIX)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(CXX) -o $@ $(CFLAGS) $(LDFLAGS) $^
endif endif
@ -318,24 +318,24 @@ $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
link.exe -out:"$@" $(EXE_LINK_FLAGS) $^ link.exe -out:"$@" $(EXE_LINK_FLAGS) $^
else else
$(PROGRAM): $(PROG_OBJS) $(LIBRARY) $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
$(CC) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \ $(CXX) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \
$(PROG_LIBS) $(PROG_LIBS)
endif endif
$(PROGRAM).pure: $(PROG_OBJS) $(LIBRARY) $(PROGRAM).pure: $(PROG_OBJS) $(LIBRARY)
purify $(PUREFLAGS) \ purify $(PUREFLAGS) \
$(CC) -o $@ $(PURE_OS_CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) \ $(CXX) -o $@ $(PURE_OS_CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) \
$(OTHER_LIBS) $(PROG_LIBS) $(OTHER_LIBS) $(PROG_LIBS)
ifndef PREBUILT_CPUCFG ifndef PREBUILT_CPUCFG
$(HFILES) $(CFILES): $(OBJDIR)/jsautocfg.h $(HFILES) $(CPPFILES): $(OBJDIR)/jsautocfg.h
$(OBJDIR)/jsautocfg.h: $(OBJDIR)/jscpucfg $(OBJDIR)/jsautocfg.h: $(OBJDIR)/jscpucfg
rm -f $@ rm -f $@
$(OBJDIR)/jscpucfg > $@ $(OBJDIR)/jscpucfg > $@
$(OBJDIR)/jscpucfg: $(OBJDIR)/jscpucfg.o $(OBJDIR)/jscpucfg: $(OBJDIR)/jscpucfg.o
$(CC) -o $@ $(OBJDIR)/jscpucfg.o $(CXX) -o $@ $(OBJDIR)/jscpucfg.o
# Add to TARGETS for clobber rule # Add to TARGETS for clobber rule
TARGETS += $(OBJDIR)/jsautocfg.h $(OBJDIR)/jscpucfg \ TARGETS += $(OBJDIR)/jsautocfg.h $(OBJDIR)/jscpucfg \
@ -349,9 +349,9 @@ DEPENDENCIES = $(CFILES:%.c=$(OBJDIR)/%.d)
# Hardwire dependencies for jsinvoke.c # Hardwire dependencies for jsinvoke.c
# #
ifdef USE_MSVC ifdef USE_MSVC
$(OBJDIR)/jsinvoke.obj : jsinterp.h jsinterp.c $(OBJDIR)/jsinvoke.obj : jsinterp.h jsinterp.cpp
else else
$(OBJDIR)/jsinvoke.o : jsinterp.h jsinterp.c $(OBJDIR)/jsinvoke.o : jsinterp.h jsinterp.cpp
endif endif
-include $(DEPENDENCIES) -include $(DEPENDENCIES)
@ -360,5 +360,5 @@ TARNAME = jsref.tar
TARFILES = files `cat files` TARFILES = files `cat files`
SUFFIXES: .i SUFFIXES: .i
%.i: %.c %.i: %.cpp
$(CC) -C -E $(CFLAGS) $< > $*.i $(CXX) -C -E $(CFLAGS) $< > $*.i

View File

@ -49,7 +49,7 @@ CFLAGS += -Wall -Wno-format -MMD
OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN
RANLIB = ranlib RANLIB = ranlib
MKSHLIB = $(CC) -dynamiclib $(XMKSHLIBOPTS) -framework System MKSHLIB = $(CCC) -dynamiclib $(XMKSHLIBOPTS) -framework System
SO_SUFFIX = dylib SO_SUFFIX = dylib

View File

@ -40,4 +40,4 @@
#define js_invoke_c__ #define js_invoke_c__
#include "jsinterp.c" #include "jsinterp.cpp"

View File

@ -43,15 +43,15 @@
# #
ifdef USE_MSVC ifdef USE_MSVC
LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CFILES:.c=.obj)) LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CPPFILES:.cpp=.obj))
PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CFILES:.c=.obj)) PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CPPFILES:.cpp=.obj))
else else
LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CFILES:.c=.o)) LIB_OBJS = $(addprefix $(OBJDIR)/, $(LIB_CPPFILES:.cpp=.o))
LIB_OBJS += $(addprefix $(OBJDIR)/, $(LIB_ASFILES:.s=.o)) LIB_OBJS += $(addprefix $(OBJDIR)/, $(LIB_ASFILES:.s=.o))
PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CFILES:.c=.o)) PROG_OBJS = $(addprefix $(OBJDIR)/, $(PROG_CPPFILES:.cpp=.o))
endif endif
CFILES = $(LIB_CFILES) $(PROG_CFILES) CPPFILES = $(LIB_CPPFILES) $(PROG_CPPFILES)
OBJS = $(LIB_OBJS) $(PROG_OBJS) OBJS = $(LIB_OBJS) $(PROG_OBJS)
ifdef USE_MSVC ifdef USE_MSVC
@ -68,43 +68,43 @@ ifneq "$(strip $(TARGETS))" ""
endif endif
+$(LOOP_OVER_DIRS) +$(LOOP_OVER_DIRS)
$(OBJDIR)/%: %.c $(OBJDIR)/%: %.cpp
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -o $@ $(CFLAGS) $*.c $(LDFLAGS) $(CXX) -o $@ $(CFLAGS) $*.cpp $(LDFLAGS)
# This rule must come before the rule with no dep on header # This rule must come before the rule with no dep on header
$(OBJDIR)/%.o: %.c %.h $(OBJDIR)/%.o: %.cpp %.h
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -o $@ -c $(CFLAGS) $*.c $(CXX) -o $@ -c $(CFLAGS) $*.cpp
$(OBJDIR)/jsinterp.o: jsinterp.c jsinterp.h $(OBJDIR)/jsinterp.o: jsinterp.cpp jsinterp.h
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -o $@ -c $(INTERP_CFLAGS) jsinterp.c $(CXX) -o $@ -c $(INTERP_CFLAGS) jsinterp.cpp
$(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: %.cpp
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -o $@ -c $(CFLAGS) $*.c $(CXX) -o $@ -c $(CFLAGS) $*.cpp
$(OBJDIR)/%.o: %.s $(OBJDIR)/%.o: %.s
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(AS) -o $@ $(ASFLAGS) $*.s $(AS) -o $@ $(ASFLAGS) $*.s
# This rule must come before rule with no dep on header # This rule must come before rule with no dep on header
$(OBJDIR)/%.obj: %.c %.h $(OBJDIR)/%.obj: %.cpp %.h
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.c $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.cpp
$(OBJDIR)/jsinterp.obj: jsinterp.c jsinterp.h $(OBJDIR)/jsinterp.obj: jsinterp.cpp jsinterp.h
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -Fo$(OBJDIR)/ -c $(INTERP_CFLAGS) $(JSDLL_CFLAGS) jsinterp.c $(CXX) -Fo$(OBJDIR)/ -c $(INTERP_CFLAGS) $(JSDLL_CFLAGS) jsinterp.c
$(OBJDIR)/%.obj: %.c $(OBJDIR)/%.obj: %.cpp
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.c $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.cpp
$(OBJDIR)/js.obj: js.c $(OBJDIR)/js.obj: js.cpp
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
$(CC) -Fo$(OBJDIR)/ -c $(CFLAGS) $< $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $<
ifeq ($(OS_ARCH),OS2) ifeq ($(OS_ARCH),OS2)
$(LIBRARY): $(LIB_OBJS) $(LIBRARY): $(LIB_OBJS)