Cross-compiling is tricky

parent 7562ed27
......@@ -36,7 +36,7 @@ compile-for-windows:
image: dockcross/windows-x64
stage: build
script:
- make
- make TARGET_OS=Windows_NT
- mv dukboot dukboot-windows.exe
artifacts:
paths:
......
......@@ -2,14 +2,21 @@ CC ?= gcc
CFLAGS = -fopenmp -Ideps -Os -pedantic -std=c99 -Wall -fstrict-aliasing -fomit-frame-pointer -D_GNU_SOURCE
LDFLAGS = -static -static-libgcc -lm
ifeq ($(OS),Windows_NT)
BIN = dukboot.exe
HOST_OS ?= $(OS)
TARGET_OS ?= $(OS)
ifeq ($(HOST_OS),Windows_NT)
MAKEHEADERS = makeheaders.exe
else
MAKEHEADERS = makeheaders
endif
ifeq ($(TARGET_OS),Windows_NT)
BIN = dukboot.exe
CFLAGS += -DMS_WINDOWS
LDFLAGS += -lwsock32
else
BIN = dukboot
MAKEHEADERS = makeheaders
CFLAGS += -DUNIX
endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment