Allow cross-compilation.
parent
d441b3bf88
commit
3190dae731
5
makefile
5
makefile
|
@ -5,8 +5,11 @@ help:
|
||||||
|
|
||||||
ZIGOPTS ?=
|
ZIGOPTS ?=
|
||||||
ZIGOPTIM ?= ReleaseSafe
|
ZIGOPTIM ?= ReleaseSafe
|
||||||
|
|
||||||
|
-include makefile.target
|
||||||
|
|
||||||
build:
|
build:
|
||||||
zig build -Doptimize=$(ZIGOPTIM) $(ZIGOPTS)
|
zig build -Doptimize=$(ZIGOPTIM) $(ZIGOPTS) $(TARGET_OPTION)
|
||||||
|
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
LIBDIR ?= $(PREFIX)/lib
|
LIBDIR ?= $(PREFIX)/lib
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# This makefile include specific target options.
|
||||||
|
|
||||||
|
TARGET ?=
|
||||||
|
|
||||||
|
ifneq ($(TARGET),)
|
||||||
|
TARGET_OPTION=-Dtarget=$(TARGET)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# In case the target is openbsd, and since the OpenBSD libc doesn't include a few system calls
|
||||||
|
# used in any other zig compilation mode, we are forced to compile in ReleaseSmall.
|
||||||
|
ifeq ($(TARGET),x86_64-openbsd)
|
||||||
|
ZIGOPTIM = ReleaseSmall
|
||||||
|
endif
|
Loading…
Reference in New Issue