From d0089c4d889532a913d775c1eed2229d6d1a2c5b Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 26 Oct 2007 08:34:54 -0600 Subject: [PATCH] makefile fixes --- makefile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/makefile b/makefile index 78608d0207..8c2debfafd 100644 --- a/makefile +++ b/makefile @@ -60,6 +60,13 @@ common-cflags = $(warnings) -fno-rtti -fno-exceptions \ -I$(JAVA_HOME)/include -idirafter $(src) -I$(native-build) \ -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 asm = x86 begin-merge-archive = -Wl,--whole-archive @@ -91,11 +98,6 @@ ifeq ($(platform),windows) cflags = $(common-cflags) -I$(inc) endif -cflags = $(common-cflags) -fPIC -fvisibility=hidden \ - -I$(JAVA_HOME)/include/linux -I$(src) $(pthread) - -lflags = $(lpthread) -ldl -lm -lz - ifeq ($(mode),debug) cflags += -O0 -g3 endif @@ -170,7 +172,7 @@ interpreter-objects = \ 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 = \ $(src)/input.h \ @@ -277,11 +279,13 @@ $(interpreter-cpp-objects): \ $(interpreter-asm-objects): $(native-build)/%-asm.o: $(src)/%.S $(compile-object) -$(driver-objects): $(native-build)/%.o: $(src)/%.cpp +$(driver-object): $(native-build)/%.o: $(src)/%.cpp $(compile-object) $(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) echo $(classpath-classes) @@ -298,7 +302,7 @@ $(classpath-object): $(build)/classpath.c $(generator-objects): $(native-build)/%.o: $(src)/%.cpp @echo "compiling $(@)" @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 @echo "compiling $(@)" @@ -318,7 +322,7 @@ else $(ranlib) $(@) endif -$(interpreter): $(archive) $(driver-objects) +$(interpreter): $(archive) $(driver-object) @echo "linking $(@)" $(cc) $(begin-merge-archive) $(^) $(end-merge-archive) \ $(lflags) $(rdynamic) -o $(@)