First (failed) attempt to make work with mingw.

This commit is contained in:
David Given
2019-07-06 12:58:20 +02:00
parent e13f4942a0
commit 7d42dff2f1
2 changed files with 17 additions and 14 deletions

View File

@@ -1,13 +1,27 @@
PACKAGES = zlib slite3 libusb-1.0
ifeq ($(OS), Windows_NT)
export CXX = i686-w64-mingw32-g++
export AR = i686-w64-mingw32-ar rcs
export STRIP = i686-w64-mingw32-strip
export CFLAGS = -Og -g --std=c++14 -I/usr/i686-w64-mingw32/sys-root/mingw/include/libusb-1.0
export LDFLAGS = -Og
export LIBS = -static -lz -lsqlite3 -Wl,-Bdynamic -lusb-1.0
else
export CXX = g++
export AR = ar rcs
export STRIP = strip
export CFLAGS = -Og -g --std=c++14
export CFLAGS = -Og -g --std=c++14 $(pkg-config --cflags $(PACKAGES))
export LDFLAGS = -Og
export LIBS = $(pkg-config --libs $(PACKAGES))
endif
CFLAGS += -Ilib -Idep/fmt
export OBJDIR = .obj
all: .obj/build.ninja
@ninja -f .obj/build.ninja
@ninja -f .obj/build.ninja -v
clean:
@echo CLEAN

View File

@@ -1,8 +1,5 @@
#!/bin/sh
set -e
packages="zlib sqlite3 libusb-1.0"
pkgcflags="$(pkg-config --cflags $packages) -Idep/fmt"
pkgldflags=$(pkg-config --libs $packages)
cat <<EOF
rule cxx
@@ -16,7 +13,7 @@ rule library
description = AR \$in
rule link
command = $CXX $LDFLAGS -o \$out \$in \$flags
command = $CXX $LDFLAGS -o \$out \$in \$flags $LIBS
description = LINK \$in
rule test
@@ -96,12 +93,9 @@ runtest() {
shift
buildlibrary lib$prog.a \
-Ilib \
$pkgcflags \
"$@"
buildprogram $OBJDIR/$prog \
$pkgldflags \
lib$prog.a \
libbackend.a \
libfmt.a
@@ -114,8 +108,6 @@ buildlibrary libfmt.a \
dep/fmt/posix.cc \
buildlibrary libbackend.a \
-Ilib \
$pkgcflags \
lib/aeslanier/decoder.cc \
lib/amiga/decoder.cc \
lib/apple2/decoder.cc \
@@ -158,8 +150,6 @@ buildlibrary libbackend.a \
lib/zilogmcz/decoder.cc \
buildlibrary libfrontend.a \
-Ilib \
$pkgcflags \
src/fe-erase.cc \
src/fe-inspect.cc \
src/fe-readadfs.cc \
@@ -187,7 +177,6 @@ buildlibrary libfrontend.a \
src/fluxengine.cc \
buildprogram fluxengine-debug \
$pkgldflags \
libfrontend.a \
libbackend.a \
libfmt.a \