Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 1 | # Copyright 2011 The Android Open Source Project |
| 2 | # |
Raphael | d2d6999 | 2012-01-24 15:06:56 -0800 | [diff] [blame] | 3 | # Android.mk for find_java.exe & static library |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 4 | |
| 5 | |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 6 | LOCAL_PATH := $(call my-dir) |
Raphael | 628920b | 2011-11-22 10:40:13 -0800 | [diff] [blame] | 7 | |
Raphael | d2d6999 | 2012-01-24 15:06:56 -0800 | [diff] [blame] | 8 | # find_java static library for host (used by find_java.exe and installer) |
| 9 | # ======================================================================= |
Raphael | 628920b | 2011-11-22 10:40:13 -0800 | [diff] [blame] | 10 | |
| 11 | include $(CLEAR_VARS) |
| 12 | |
Raphael | d7cebf6 | 2012-01-25 13:50:18 -0800 | [diff] [blame] | 13 | ifeq ($(HOST_OS),windows) |
| 14 | |
Raphael | 628920b | 2011-11-22 10:40:13 -0800 | [diff] [blame] | 15 | LOCAL_MODULE := libfindjava |
Raphael | d7cebf6 | 2012-01-25 13:50:18 -0800 | [diff] [blame] | 16 | LOCAL_SRC_FILES := find_java_lib.cpp utils.cpp |
Raphael | 628920b | 2011-11-22 10:40:13 -0800 | [diff] [blame] | 17 | |
| 18 | LOCAL_CFLAGS += -Wall -Wno-unused-parameter |
| 19 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -DSH_HISTORY -DUSE_MINGW |
| 20 | |
| 21 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 22 | |
| 23 | |
Raphael | d2d6999 | 2012-01-24 15:06:56 -0800 | [diff] [blame] | 24 | # "find_java.exe", to be used from android.bat & co |
| 25 | # ================================================= |
Raphael | 628920b | 2011-11-22 10:40:13 -0800 | [diff] [blame] | 26 | |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 27 | include $(CLEAR_VARS) |
| 28 | |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 29 | LOCAL_SRC_FILES := \ |
Raphael | d7cebf6 | 2012-01-25 13:50:18 -0800 | [diff] [blame] | 30 | find_java_exe.cpp |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 31 | |
Raphael | d2d6999 | 2012-01-24 15:06:56 -0800 | [diff] [blame] | 32 | LOCAL_MODULE := find_java |
Raphael | 628920b | 2011-11-22 10:40:13 -0800 | [diff] [blame] | 33 | LOCAL_STATIC_LIBRARIES := libfindjava |
| 34 | |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 35 | LOCAL_CFLAGS += -Wall -Wno-unused-parameter |
| 36 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -DSH_HISTORY -DUSE_MINGW |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 37 | |
| 38 | LOCAL_MODULE_TAGS := optional |
| 39 | |
| 40 | # Locate windres executable |
| 41 | WINDRES := windres |
| 42 | ifneq ($(USE_MINGW),) |
| 43 | # When building the Windows resources under Linux, use the MinGW one |
| 44 | WINDRES := i586-mingw32msvc-windres |
| 45 | endif |
| 46 | |
| 47 | # Link the Windows icon file as well into the executable, based on the technique |
| 48 | # used in external/qemu/Makefile.android. The variables need to have different |
| 49 | # names to not interfere with the ones from qemu/Makefile.android. |
| 50 | # |
| 51 | INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
Raphael | d2d6999 | 2012-01-24 15:06:56 -0800 | [diff] [blame] | 52 | FIND_JAVA_ICON_OBJ := find_java_icon.o |
| 53 | FIND_JAVA_ICON_PATH := $(LOCAL_PATH)/images |
| 54 | $(FIND_JAVA_ICON_PATH)/$(FIND_JAVA_ICON_OBJ): $(FIND_JAVA_ICON_PATH)/android_icon.rc |
| 55 | $(WINDRES) $< -I $(FIND_JAVA_ICON_PATH) -o $@ |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 56 | |
| 57 | # seems to be the only way to add an object file that was not generated from |
| 58 | # a C/C++/Java source file to our build system. and very unfortunately, |
| 59 | # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces |
| 60 | # us to put the object file in the source directory... |
| 61 | # |
Raphael | d2d6999 | 2012-01-24 15:06:56 -0800 | [diff] [blame] | 62 | LOCAL_PREBUILT_OBJ_FILES += images/$(FIND_JAVA_ICON_OBJ) |
Raphael | 97f3e04 | 2011-11-11 18:08:58 -0800 | [diff] [blame] | 63 | |
| 64 | include $(BUILD_HOST_EXECUTABLE) |
| 65 | |
| 66 | $(call dist-for-goals,droid,$(LOCAL_BUILT_MODULE)) |
| 67 | |
| 68 | endif |
| 69 | |
| 70 | |