1#
2#  Copyright (C) 2009 The Android Open Source Project
3#
4#  Licensed under the Apache License, Version 2.0 (the "License");
5#  you may not use this file except in compliance with the License.
6#  You may obtain a copy of the License at
7#
8#       http://www.apache.org/licenses/LICENSE-2.0
9#
10#  Unless required by applicable law or agreed to in writing, software
11#  distributed under the License is distributed on an "AS IS" BASIS,
12#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13#  See the License for the specific language governing permissions and
14#  limitations under the License.
15#
16
17TARGETNAME = AdbWinUsbApi
18TARGETPATH = obj
19TARGETTYPE = DYNLINK
20
21_NT_TARGET_VERSION = $(_NT_TARGET_VERSION_VISTA)
22
23UMTYPE = windows
24DLLDEF = AdbWinUsbApi.def
25# Use the same load address as previous versions just to be conservative. This
26# really doesn't matter on newer OSes that use ASLR.
27DLLBASE = 0x400000
28
29# Use statically linked atl libraries:
30# - atls.lib for free build
31# - atlsd.lib for checked build
32USE_STATIC_ATL  = 1
33# Use ATL v. 7.1
34ATL_VER         = 71
35# Use STL v. 6.0
36USE_STL         = 1
37STL_VER         = 60
38# Use multithreaded libraries
39USE_LIBCMT      = 1
40
41!IF !$(FREEBUILD)
42# In checked build, ATL headers call APIs that are only in atlsd.lib. To use
43# atlsd.lib in checked build, set DEBUG_CRTS.
44DEBUG_CRTS=1
45!ENDIF
46
47# Include directories
48INCLUDES = $(DDK_INC_PATH);           \
49           $(SDK_INC_PATH);           \
50           $(CRT_INC_PATH);           \
51           $(SDK_INC_PATH)\crt;       \
52           $(CRT_INC_PATH)\atl71;     \
53           $(SDK_INC_PATH)\crt\stl60
54
55# Common target libraries
56TARGETLIBS = $(SDK_LIB_PATH)\ole32.lib    \
57             $(SDK_LIB_PATH)\Advapi32.lib \
58             $(SDK_LIB_PATH)\Kernel32.lib \
59             $(SDK_LIB_PATH)\User32.lib   \
60             $(SDK_LIB_PATH)\oleaut32.lib \
61             $(SDK_LIB_PATH)\wbemuuid.lib \
62             $(SDK_LIB_PATH)\uuid.lib     \
63             $(SDK_LIB_PATH)\setupapi.lib \
64             $(SDK_LIB_PATH)\usbd.lib     \
65             $(SDK_LIB_PATH)\winusb.lib   \
66             ..\api\obj$(BUILD_ALT_DIR)\i386\AdbWinApi.lib
67
68# Common C defines
69C_DEFINES= $(C_DEFINES) -DADBWINUSB_EXPORTS -D_UNICODE \
70           -DUNICODE -DWIN32 -D_WINDOWS -D_USRDLL -D_WINDLL
71
72!IF "$(DDKBUILDENV)" == "fre"
73# C defines for release (free) builds
74C_DEFINES = $(C_DEFINES) -DNDEBUG
75!ELSE
76# C defines for debug (checked) builds
77C_DEFINES = $(C_DEFINES) -D_DEBUG
78!ENDIF
79
80# Turn on all warnings, and treat warnings as errors
81MSC_WARNING_LEVEL = /W4 /WX
82
83# operator new throws C++ exceptions
84USE_NATIVE_EH=1
85
86# Common C defines
87USER_C_FLAGS = $(USER_C_FLAGS) /FD /wd4100 /wd4200 /wd4702 /nologo
88
89# Set precompiled header information
90PRECOMPILED_CXX = 1
91PRECOMPILED_INCLUDE = stdafx.h
92PRECOMPILED_SOURCEFILE = stdafx.cpp
93
94# Define source files for AdbWinUsbApi.dll
95SOURCES = adb_winusb_endpoint_object.cpp  \
96          adb_winusb_interface.cpp        \
97          adb_winusb_io_completion.cpp    \
98          AdbWinUsbApi.cpp                \
99		      AdbWinUsbApi.rc
100