makefile fixes

This commit is contained in:
Joel Dice 2007-10-26 08:34:54 -06:00
parent 448d48adc9
commit d0089c4d88

View File

@ -60,6 +60,13 @@ common-cflags = $(warnings) -fno-rtti -fno-exceptions \
-I$(JAVA_HOME)/include -idirafter $(src) -I$(native-build) \ -I$(JAVA_HOME)/include -idirafter $(src) -I$(native-build) \
-D__STDC_LIMIT_MACROS -D_JNI_IMPLEMENTATION_ -D__STDC_LIMIT_MACROS -D_JNI_IMPLEMENTATION_
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \
-I$(JAVA_HOME)/include/linux -I$(src) $(pthread)
cflags = $(build-cflags)
lflags = $(lpthread) -ldl -lm -lz
system = posix system = posix
asm = x86 asm = x86
begin-merge-archive = -Wl,--whole-archive begin-merge-archive = -Wl,--whole-archive
@ -91,11 +98,6 @@ ifeq ($(platform),windows)
cflags = $(common-cflags) -I$(inc) cflags = $(common-cflags) -I$(inc)
endif endif
cflags = $(common-cflags) -fPIC -fvisibility=hidden \
-I$(JAVA_HOME)/include/linux -I$(src) $(pthread)
lflags = $(lpthread) -ldl -lm -lz
ifeq ($(mode),debug) ifeq ($(mode),debug)
cflags += -O0 -g3 cflags += -O0 -g3
endif endif
@ -170,7 +172,7 @@ interpreter-objects = \
driver-sources = $(src)/main.cpp driver-sources = $(src)/main.cpp
driver-objects = $(call cpp-objects,$(driver-sources),$(src),$(native-build)) driver-object = $(call cpp-objects,$(driver-sources),$(src),$(native-build))
generator-headers = \ generator-headers = \
$(src)/input.h \ $(src)/input.h \
@ -277,11 +279,13 @@ $(interpreter-cpp-objects): \
$(interpreter-asm-objects): $(native-build)/%-asm.o: $(src)/%.S $(interpreter-asm-objects): $(native-build)/%-asm.o: $(src)/%.S
$(compile-object) $(compile-object)
$(driver-objects): $(native-build)/%.o: $(src)/%.cpp $(driver-object): $(native-build)/%.o: $(src)/%.cpp
$(compile-object) $(compile-object)
$(bin2c-objects): $(native-build)/%.o: $(src)/%.cpp $(bin2c-objects): $(native-build)/%.o: $(src)/%.cpp
$(compile-object) @echo "compiling $(@)"
@mkdir -p -m 1777 $(dir $(@))
$(build-cxx) $(build-cflags) -c $(<) -o $(@)
$(build)/classpath.zip: $(classpath-classes) $(build)/classpath.zip: $(classpath-classes)
echo $(classpath-classes) echo $(classpath-classes)
@ -298,7 +302,7 @@ $(classpath-object): $(build)/classpath.c
$(generator-objects): $(native-build)/%.o: $(src)/%.cpp $(generator-objects): $(native-build)/%.o: $(src)/%.cpp
@echo "compiling $(@)" @echo "compiling $(@)"
@mkdir -p -m 1777 $(dir $(@)) @mkdir -p -m 1777 $(dir $(@))
$(build-cxx) -DPOINTER_SIZE=$(pointer-size) $(cflags) -c $(<) -o $(@) $(build-cxx) -DPOINTER_SIZE=$(pointer-size) $(build-cflags) -c $(<) -o $(@)
$(jni-objects): $(native-build)/%.o: $(classpath)/%.cpp $(jni-objects): $(native-build)/%.o: $(classpath)/%.cpp
@echo "compiling $(@)" @echo "compiling $(@)"
@ -318,7 +322,7 @@ else
$(ranlib) $(@) $(ranlib) $(@)
endif endif
$(interpreter): $(archive) $(driver-objects) $(interpreter): $(archive) $(driver-object)
@echo "linking $(@)" @echo "linking $(@)"
$(cc) $(begin-merge-archive) $(^) $(end-merge-archive) \ $(cc) $(begin-merge-archive) $(^) $(end-merge-archive) \
$(lflags) $(rdynamic) -o $(@) $(lflags) $(rdynamic) -o $(@)