qbolt/Makefile

44 lines
1.2 KiB
Makefile
Raw Normal View History

2017-05-16 07:34:54 +00:00
2017-05-21 02:33:46 +00:00
export PATH := /usr/lib/mxe/usr/bin:$(PATH)
GOFLAGS := -ldflags='-s -w' -gcflags='-trimpath=$(CURDIR)' -asmflags='-trimpath=$(CURDIR)'
2017-05-16 07:34:54 +00:00
.PHONY: all clean
2017-05-21 02:33:46 +00:00
all: \
qbolt/qbolt.a \
build/linux/qbolt \
build/win32/qbolt.exe
2017-05-16 07:34:54 +00:00
clean:
2017-05-21 02:33:46 +00:00
if [ -f qbolt/qbolt.a ] ; then rm qbolt/qbolt.a ; fi
2017-05-16 07:34:54 +00:00
if [ -f qbolt ] ; then rm qbolt ; fi
2017-05-21 02:33:46 +00:00
if [ -d build ] ; then rm -r build ; fi
# Build core golang shared library (linux)
build/linux/qbolt.a: *.go
mkdir -p build/linux
go build ${GOFLAGS} -buildmode=c-archive -o build/linux/qbolt.a
# Build core golang shared library (win32)
build/win32/qbolt.a: *.go
mkdir -p build/win32
CC=/usr/lib/mxe/usr/bin/i686-w64-mingw32.static-gcc CGO_ENABLED=1 GOARCH=386 GOOS=windows \
go build ${GOFLAGS} -buildmode=c-archive -o build/win32/qbolt.a
# Copy shared library into place for builds straight out of the IDE
qbolt/qbolt.a: build/linux/qbolt.a
cp build/linux/qbolt.a qbolt/qbolt.a
# Linux binaries
2017-05-20 02:57:19 +00:00
2017-05-21 02:33:46 +00:00
build/linux/qbolt: build/linux/qbolt.a qbolt/*
cd build/linux && qmake ../../qbolt/qbolt.pro && make
# Windows binaries
build/win32/release/qbolt.exe: build/win32/qbolt.a qbolt/*
cd build/win32 && i686-w64-mingw32.static-qmake-qt5 ../../qbolt/qbolt.pro && make