summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-09-26 09:55:29 -0400
committermidipix <writeonce@midipix.org>2015-09-26 11:05:52 -0400
commitfab898fe73eaaca3f112a00e483a3816118ee4c1 (patch)
tree3e0767b152ea1443508f388afb9a8f03d9c5fc11
parent9ed8ecba43c402aa32c84df5d3a817223898c3cc (diff)
downloaddalist-fab898fe73eaaca3f112a00e483a3816118ee4c1.tar.bz2
dalist-fab898fe73eaaca3f112a00e483a3816118ee4c1.tar.xz
apply the free-standing environment to all PE target builds.
-rw-r--r--project/extras.mk24
1 files changed, 24 insertions, 0 deletions
diff --git a/project/extras.mk b/project/extras.mk
index bece2fc..084804c 100644
--- a/project/extras.mk
+++ b/project/extras.mk
@@ -1,2 +1,26 @@
CFLAGS_SHARED_ATTR += -DDALIST_BUILD
CFLAGS_STATIC_ATTR += -DDALIST_STATIC
+
+ifeq ($(OS),midipix)
+ HOST_FMT = pe
+else ifeq ($(OS),mingw)
+ HOST_FMT = pe
+else
+ HOST_FMT = unknown
+endif
+
+ifeq ($(HOST_FMT),pe)
+ CFLAGS_CONFIG += -DMIDIPIX_FREESTANDING -ffreestanding -D__NT$(HOST_BITS)
+ CFLAGS_CONFIG += -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__
+ CFLAGS_CONFIG += -UWIN64 -U_WIN64 -U__WIN64 -U__WIN64__
+
+ LDFLAGS_SHARED += -nostdlib
+ LDFLAGS_SHARED += -Wl,--out-implib,$(SHARED_IMPLIB)
+ LDFLAGS_SHARED += -Wl,--exclude-all-symbols
+
+ ifeq ($(HOST_BITS),32)
+ LDFLAGS_SHARED += -Wl,--entry,$(HOST_UNDERSCORE)dalist_entry_point@12
+ else
+ LDFLAGS_SHARED += -Wl,--entry,$(HOST_UNDERSCORE)dalist_entry_point
+ endif
+endif