blob: a50b3c772b2580c6f09da70b5b9e92ac4f66db82 [file] [log] [blame]
Raphael97f3e042011-11-11 18:08:58 -08001# 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
10LOCAL_PATH := $(call my-dir)
11include $(CLEAR_VARS)
12
13ifeq ($(HOST_OS),windows)
14
15LOCAL_SRC_FILES := \
16 win_android.cpp
17
18LOCAL_CFLAGS += -Wall -Wno-unused-parameter
19LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -DSH_HISTORY -DUSE_MINGW
20LOCAL_MODULE := win_android
21
22LOCAL_MODULE_TAGS := optional
23
24# Locate windres executable
25WINDRES := windres
26ifneq ($(USE_MINGW),)
27 # When building the Windows resources under Linux, use the MinGW one
28 WINDRES := i586-mingw32msvc-windres
29endif
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#
35INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true)
36WIN_ANDROID_ICON_OBJ := win_android_icon.o
37WIN_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#
46LOCAL_PREBUILT_OBJ_FILES += images/$(WIN_ANDROID_ICON_OBJ)
47
48include $(BUILD_HOST_EXECUTABLE)
49
50$(call dist-for-goals,droid,$(LOCAL_BUILT_MODULE))
51
52endif
53
54