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