Skip to content

Commit

Permalink
Adds a J2OBJC_ARCHS variable to specify which architectures should be…
Browse files Browse the repository at this point in the history
… compiled for.

	Change on 2013/09/18 by kstanger <kstanger@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=52515212
  • Loading branch information
tomball committed Oct 8, 2013
1 parent e616aef commit e2a7887
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
8 changes: 6 additions & 2 deletions jre_emul/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ EMULATION_MACOSX_LIB = $(BUILD_DIR)/macosx-libjre_emul.a
EMULATION_IPHONE_LIB = $(BUILD_DIR)/iphone-libjre_emul.a
EMULATION_IPHONEV7S_LIB = $(BUILD_DIR)/iphonev7s-libjre_emul.a
EMULATION_SIMULATOR_LIB = $(BUILD_DIR)/simulator-libjre_emul.a
ARCH_LIBS = $(J2OBJC_ARCHS)
ARCH_LIBS := $(ARCH_LIBS:macosx=$(EMULATION_MACOSX_LIB))
ARCH_LIBS := $(ARCH_LIBS:iphone=$(EMULATION_IPHONE_LIB))
ARCH_LIBS := $(ARCH_LIBS:iphonev7s=$(EMULATION_IPHONEV7s_LIB))
ARCH_LIBS := $(ARCH_LIBS:simulator=$(EMULATION_SIMULATOR_LIB))
MACOSX_OBJS = $(ALL_OBJS:%=$(CLASS_DIR)/%)
MACOSX_FLAGS = $(SDK_FLAGS)
IPHONE_BUILD_DIR = $(BUILD_DIR)/iphone
Expand Down Expand Up @@ -588,8 +593,7 @@ xcode_clean:

xcode_analyze: $(ALL_OBJS:%.o=$(TARGET_TEMP_DIR)/%.plist)

$(EMULATION_LIB): $(EMULATION_MACOSX_LIB) $(EMULATION_IPHONE_LIB) \
$(EMULATION_IPHONEV7S_LIB) $(EMULATION_SIMULATOR_LIB)
$(EMULATION_LIB): $(ARCH_LIBS)
$(LIPO) -create $^ -output $@

$(EMULATION_MACOSX_LIB): $(MACOSX_OBJS)
Expand Down
24 changes: 14 additions & 10 deletions junit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ EMULATION_MACOSX_LIB = $(BUILD_DIR)/macosx-libjunit.a
EMULATION_IPHONE_LIB = $(BUILD_DIR)/iphone-libjunit.a
EMULATION_IPHONEV7S_LIB = $(BUILD_DIR)/iphonev7s-libjunit.a
EMULATION_SIMULATOR_LIB = $(BUILD_DIR)/simulator-libjunit.a
ARCH_LIBS = $(J2OBJC_ARCHS)
ARCH_LIBS := $(ARCH_LIBS:macosx=$(EMULATION_MACOSX_LIB))
ARCH_LIBS := $(ARCH_LIBS:iphone=$(EMULATION_IPHONE_LIB))
ARCH_LIBS := $(ARCH_LIBS:iphonev7s=$(EMULATION_IPHONEV7s_LIB))
ARCH_LIBS := $(ARCH_LIBS:simulator=$(EMULATION_SIMULATOR_LIB))
MACOSX_OBJS = $(OBJS:%=$(BUILD_DIR)/%)
MACOSX_FLAGS = $(SDK_FLAGS)
IPHONE_BUILD_DIR = $(BUILD_DIR)/iphone
Expand Down Expand Up @@ -231,25 +236,24 @@ $(JUNIT_LIB): $(OBJS:%=$(TARGET_TEMP_DIR)/%)
@mkdir -p $(@D)
$(LIBTOOL) -static -o $@ $^
else
$(JUNIT_LIB): $(EMULATION_MACOSX_LIB) $(EMULATION_IPHONE_LIB) \
$(EMULATION_IPHONEV7S_LIB) $(EMULATION_SIMULATOR_LIB)
$(JUNIT_LIB): $(ARCH_LIBS)
$(LIPO) -create $^ -output $@

$(EMULATION_MACOSX_LIB): $(MACOSX_OBJS)
echo "building Mac OS X library"
$(LIBTOOL) -static -o $@ $^
@echo "building junit Mac OS X library"
@$(LIBTOOL) -static -o $@ $^

$(EMULATION_IPHONE_LIB): $(IPHONE_OBJS)
echo "building iPhoneOS library"
$(LIBTOOL) -static -o $@ $^
@echo "building junit iPhoneOS library"
@$(LIBTOOL) -static -o $@ $^

$(EMULATION_IPHONEV7S_LIB): $(IPHONEV7S_OBJS)
echo "building iPhonev7S library"
$(LIBTOOL) -static -o $@ $^
@echo "building junit iPhonev7S library"
@$(LIBTOOL) -static -o $@ $^

$(EMULATION_SIMULATOR_LIB): $(SIMULATOR_OBJS)
echo "building iPhoneSimulator library"
$(LIBTOOL) -static -o $@ $^
@echo "building junit iPhoneSimulator library"
@$(LIBTOOL) -static -o $@ $^
endif

define compile_rules
Expand Down
4 changes: 4 additions & 0 deletions make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ ARCH_LIB_DIR = $(DIST_LIB_DIR)
ARCH_INCLUDE_DIR = $(DIST_INCLUDE_DIR)
endif

ifndef J2OBJC_ARCHS
J2OBJC_ARCHS = macosx iphone iphonev7s simulator
endif

# xcrun finds a specified tool in the current SDK /usr/bin directory.
XCRUN = $(shell if test -f /usr/bin/xcrun; then echo xcrun; else echo ""; fi)
MAKE = $(XCRUN) make
Expand Down

0 comments on commit e2a7887

Please sign in to comment.