1 # This Makefile should work under Linux and Mingw32 (in Windows)
3 # Requires C++11 and C99 (only variable length arrays)) compatible compiler
4 # (tested with gcc 4.7, clang 3.2)
6 # Archlinux note: following packages are compiled without static libs
7 # (use custom PKGBUILD): fltk, sqlite
9 # http://tehsausage.com/mingw-to-string
11 # CLANG does not have -ggdb3
17 DEBUG
= -DDEBUG
-O0
-g
-ggdb3
18 WARNINGS
= -Wall
-Wno-vla
-pedantic
20 LIBS
= -L
/usr
/local
/lib
-L
/lib
22 CURL_CFLAGS
= $(shell curl-config
--cflags)
23 CURL_LIBS
= $(shell curl-config
--libs
)
24 CURL_STATICLIBS
= $(shell curl-config
--libs
)
25 FLTK_CXXFLAGS
= $(shell fltk-config
--cxxflags)
26 FLTK_LIBS
= $(shell fltk-config
--use-images
--ldflags --libs
)
27 FLTK_STATICLIBS
= $(shell fltk-config
--use-images
--ldstaticflags
--libs
)
30 CXXFLAGS
= ${CURL_CFLAGS} ${INCLUDE} -std
=c
++11 ${WARNINGS} ${FLTK_CXXFLAGS}
31 LDFLAGS
= ${LIBS} ${FLTK_LIBS} ${FLTK_LIBS} -lstdc
++ -lz
${CURL_LIBS}
32 LDSTATICFLAGS
= ${LIBS} ${FLTK_STATICLIBS} ${CURL_STATICLIBS} -static-libgcc
-static-libstdc
++
36 # OS specific settings
37 ifeq ($(shell uname
), Linux
)
42 # -mwindows: dont use console for stdout/stderr
44 LDFLAGS
=${LDSTATICFLAGS} -mconsole
49 src
/3rdparty
/sqlite3.o\
63 src
/3rdparty
/sqlite3.c\
77 src
/3rdparty
/sqlite3.h\
78 src
/3rdparty
/sqlite3ext.h\
79 src
/3rdparty
/rapidxml.hpp\
98 ${CC} ${CFLAGS} -c
$< -o
$@
101 ${CXX} ${CXXFLAGS} ${DEBUG} -c
$< -o
$@
104 ${CXX} ${CXXFLAGS} ${DEBUG} ${OBJ} -o
${NAME} ${LDFLAGS}
110 rm -f src
/*.o src
/3rdparty
/*.o src
/gui
/*.o
${NAME} 2>/dev
/null
114 distro
: clean ${NAME} strip