install include files
[MKUltra.git] / defs.Win32
blobc87bd8fcee12a0d001fc603b8e1043ecb0ecba63
1 # -*- Mode: makefile; -*- #
3 # This file is part of MKUltra - Gene's ultimate make include files.
5 # Copyright © 2016-2017 Gene Hightower <gene@digilicious.com>
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, version 3.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  See the file LICENSE.  If not, see
18 # <http://www.gnu.org/licenses/>.
20 a_ext := lib
21 a_sfx := .$(a_ext)
22 a_pfx :=
24 so_ext := dll
25 so_sfx := .$(so_ext)
26 so_pfx :=
28 o_ext := obj
29 o_sfx := .$(o_ext)
31 exe_ext := exe
32 exe_sfx := .$(exe_ext)
34 arch := i686
35 #arch := x86_64
37 mingw := $(arch)-w64-mingw32
39 mingw_root := /usr/$(mingw)/sys-root/mingw
41 pkg_config_path := $(mingw_root)/lib/pkgconfig
43 boost_mt := -mt
45 CXX := $(mingw)-g++
46 WINDRES := $(mingw)-windres
48 # <https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx>
49 # 0x05010000 == Windows XP
51 CXXFLAGS += -DWIN32 -D_WIN32_WINNT=0x05010000 -DUNICODE -D_UNICODE -D_MT
52 LDFLAGS += -Wl,-subsystem,windows
53 #LDFLAGS += -Wl,-subsystem,console
55 LDFLAGS += -lpsapi
57 %$(o_sfx):%.cpp
58         $(COMPILE.cpp) $(OUTPUT_OPTION) $<
60 %$(o_sfx):%.c
61         $(COMPILE.c) $(OUTPUT_OPTION) $<
63 %.res: %.rc
64         $(WINDRES) -O coff $(OUTPUT_OPTION) $<
66 ifneq (,$(JAVA))
68 define possibly_set_java_home
69 ifneq (,$(wildcard $(1)))
70 JAVA_HOME ?= $(1)
71 endif
72 endef
74 possible_java_locations := /cygdrive/c/Java/jdk1.8.0_65 /usr/lib/jvm/java-1.8.0-openjdk
76 $(foreach x,$(possible_java_locations),$(eval $(call possibly_set_java_home,$(x))))
78 # Fall back to "native" Java for Win32 build
79 JAVA_HOME ?= /usr/lib/jvm/java-1.8.0-openjdk
80 jvmdir = $(JAVA_HOME)/lib
82 CPPFLAGS += -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32
83 #LDLIBS += $(jvmdir)/jvm.lib
84 endif