diff --git a/.appveyor.yml b/.appveyor.yml index 21a490ea..f4714833 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,7 +15,7 @@ install: build_script: - make - - zip -9 fluxengine.zip fluxengine.exe + - zip -9 fluxengine.zip fluxengine.exe brother120tool.exe cwftoflux.exe artifacts: - path: fluxengine.zip diff --git a/Makefile b/Makefile index ff92df35..6e23dc15 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,23 @@ PACKAGES = zlib sqlite3 libusb-1.0 +export CFLAGS = -O3 -g --std=c++14 \ + -ffunction-sections -fdata-sections +export LDFLAGS = -O3 + ifeq ($(OS), Windows_NT) export CXX = /mingw32/bin/g++ export AR = /mingw32/bin/ar rcs export STRIP = /mingw32/bin/strip -export CFLAGS = -O3 -g --std=c++14 -I/mingw32/include/libusb-1.0 -export LDFLAGS = -O3 +export CFLAGS += -I/mingw32/include/libusb-1.0 +export LDFLAGS += export LIBS = -static -lz -lsqlite3 -lusb-1.0 export EXTENSION = .exe else export CXX = g++ export AR = ar rcs export STRIP = strip -export CFLAGS = -Og -g --std=c++14 $(shell pkg-config --cflags $(PACKAGES)) -export LDFLAGS = -Og +export CFLAGS += $(shell pkg-config --cflags $(PACKAGES)) +export LDFLAGS += export LIBS = $(shell pkg-config --libs $(PACKAGES)) export EXTENSION = endif diff --git a/mkninja.sh b/mkninja.sh index d99c05ad..0e15a279 100644 --- a/mkninja.sh +++ b/mkninja.sh @@ -83,8 +83,10 @@ buildprogram() { objs="$objs $OBJDIR/$src" done - echo build $prog : link $objs + echo build $prog-debug$EXTENSION : link $objs echo " flags=$flags" + + echo build $prog$EXTENSION : strip $prog-debug$EXTENSION } runtest() { @@ -100,7 +102,7 @@ runtest() { libbackend.a \ libfmt.a - echo build $OBJDIR/$prog.stamp : test $OBJDIR/$prog$EXTENSION + echo build $OBJDIR/$prog.stamp : test $OBJDIR/$prog-debug$EXTENSION } buildlibrary libfmt.a \ @@ -176,12 +178,25 @@ buildlibrary libfrontend.a \ src/fe-writetestpattern.cc \ src/fluxengine.cc \ -buildprogram fluxengine-debug$EXTENSION \ +buildprogram fluxengine \ libfrontend.a \ libbackend.a \ libfmt.a \ -echo "build fluxengine$EXTENSION : strip fluxengine-debug$EXTENSION" +buildlibrary libbrother120tool.a \ + tools/brother120tool.cc \ + +buildprogram brother120tool \ + libbrother120tool.a \ + libfmt.a \ + +buildlibrary libcwftoflux.a \ + tools/cwftoflux.cc \ + +buildprogram cwftoflux \ + libcwftoflux.a \ + libbackend.a \ + libfmt.a \ runtest dataspec-test tests/dataspec.cc runtest flags-test tests/flags.cc