blob: ba8b5cb3d541eb52ad1a8f48c7a13830bf60b2d6 [file] [log] [blame]
Raphael97f3e042011-11-11 18:08:58 -08001# Copyright 2011 The Android Open Source Project
2#
Raphaeld2d69992012-01-24 15:06:56 -08003# Android.mk for find_java.exe & static library
Raphael97f3e042011-11-11 18:08:58 -08004
5
Raphael97f3e042011-11-11 18:08:58 -08006LOCAL_PATH := $(call my-dir)
Raphael628920b2011-11-22 10:40:13 -08007
Raphaeld2d69992012-01-24 15:06:56 -08008# find_java static library for host (used by find_java.exe and installer)
9# =======================================================================
Raphael628920b2011-11-22 10:40:13 -080010
11include $(CLEAR_VARS)
12
Raphaeld7cebf62012-01-25 13:50:18 -080013ifeq ($(HOST_OS),windows)
14
Raphael628920b2011-11-22 10:40:13 -080015LOCAL_MODULE := libfindjava
Raphaeld7cebf62012-01-25 13:50:18 -080016LOCAL_SRC_FILES := find_java_lib.cpp utils.cpp
Raphael628920b2011-11-22 10:40:13 -080017
18LOCAL_CFLAGS += -Wall -Wno-unused-parameter
19LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -DSH_HISTORY -DUSE_MINGW
20
21include $(BUILD_HOST_STATIC_LIBRARY)
22
23
Raphaeld2d69992012-01-24 15:06:56 -080024# "find_java.exe", to be used from android.bat & co
25# =================================================
Raphael628920b2011-11-22 10:40:13 -080026
Raphael97f3e042011-11-11 18:08:58 -080027include $(CLEAR_VARS)
28
Raphael97f3e042011-11-11 18:08:58 -080029LOCAL_SRC_FILES := \
Raphaeld7cebf62012-01-25 13:50:18 -080030 find_java_exe.cpp
Raphael97f3e042011-11-11 18:08:58 -080031
Raphaeld2d69992012-01-24 15:06:56 -080032LOCAL_MODULE := find_java
Raphael628920b2011-11-22 10:40:13 -080033LOCAL_STATIC_LIBRARIES := libfindjava
34
Raphael97f3e042011-11-11 18:08:58 -080035LOCAL_CFLAGS += -Wall -Wno-unused-parameter
36LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -DSH_HISTORY -DUSE_MINGW
Raphael97f3e042011-11-11 18:08:58 -080037
38LOCAL_MODULE_TAGS := optional
39
40# Locate windres executable
41WINDRES := windres
42ifneq ($(USE_MINGW),)
43 # When building the Windows resources under Linux, use the MinGW one
44 WINDRES := i586-mingw32msvc-windres
45endif
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#
51INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true)
Raphaeld2d69992012-01-24 15:06:56 -080052FIND_JAVA_ICON_OBJ := find_java_icon.o
53FIND_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 $@
Raphael97f3e042011-11-11 18:08:58 -080056
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#
Raphaeld2d69992012-01-24 15:06:56 -080062LOCAL_PREBUILT_OBJ_FILES += images/$(FIND_JAVA_ICON_OBJ)
Raphael97f3e042011-11-11 18:08:58 -080063
64include $(BUILD_HOST_EXECUTABLE)
65
66$(call dist-for-goals,droid,$(LOCAL_BUILT_MODULE))
67
68endif
69
70