1 # -*- Mode: makefile; -*- #
11 exe_sfx := .$(exe_ext)
16 mingw := $(arch)-w64-mingw32
18 mingw_root := /usr/$(mingw)/sys-root/mingw
20 pkg_config_path := $(mingw_root)/lib/pkgconfig
25 WINDRES := $(mingw)-windres
27 # <https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx>
28 # 0x05010000 == Windows XP
30 CXXFLAGS += -DWIN32 -D_WIN32_WINNT=0x05010000 -DUNICODE -D_UNICODE -D_MT
31 LDFLAGS += -Wl,-subsystem,windows
32 #LDFLAGS += -Wl,-subsystem,console
37 $(COMPILE.cpp) $(OUTPUT_OPTION) $<
40 $(COMPILE.c) $(OUTPUT_OPTION) $<
43 $(WINDRES) -O coff $(OUTPUT_OPTION) $<
47 define possibly_set_java_home
48 ifneq (,$(wildcard $(1)))
53 possible_java_locations := /cygdrive/c/Java/jdk1.8.0_65 /usr/lib/jvm/java-1.8.0-openjdk
55 $(foreach x,$(possible_java_locations),$(eval $(call possibly_set_java_home,$(x))))
57 # Fall back to "native" Java for Win32 build
58 JAVA_HOME ?= /usr/lib/jvm/java-1.8.0-openjdk
59 jvmdir = $(JAVA_HOME)/lib
61 CPPFLAGS += -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32
62 #LDLIBS += $(jvmdir)/jvm.lib