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 # http://tehsausage.com/mingw-to-string
8 # CLANG does not have -ggdb3
12 DEBUG
= -DDEBUG
-g
-ggdb3
13 WARNINGS
= -Wall
-Wno-vla
-Wno-long-long
-pedantic
16 LIBS
= -L
/usr
/local
/lib
-L
/lib
18 CURL_CFLAGS
= $(shell curl-config
--cflags)
19 CURL_LIBS
= $(shell curl-config
--libs
)
20 CURL_STATICLIBS
= $(shell curl-config
--libs
)
21 FLTK_CXXFLAGS
= $(shell fltk-config
--cxxflags)
22 FLTK_LIBS
= $(shell fltk-config
--use-images
--ldflags --libs
)
23 FLTK_STATICLIBS
= $(shell fltk-config
--use-images
--ldstaticflags
--libs
)
26 CXXFLAGS
= ${CURL_CFLAGS} ${INCLUDE} -std
=c
++11 ${WARNINGS} ${FLTK_CXXFLAGS}
27 LDFLAGS
= ${LIBS} ${FLTK_LIBS} ${FLTK_LIBS} -lstdc
++ -lz
${CURL_LIBS}
28 LDSTATICFLAGS
= ${LIBS} ${FLTK_STATICLIBS} ${CURL_STATICLIBS} -static-libgcc
-static-libstdc
++
32 # OS specific settings
33 ifeq ($(shell uname
), Linux
)
38 # -mwindows: dont use console for stdout/stderr
40 LDFLAGS
=${LDSTATICFLAGS} -mwindows
45 src
/3rdparty
/sqlite3.o\
59 src
/3rdparty
/sqlite3.c\
73 src
/3rdparty
/sqlite3.h\
74 src
/3rdparty
/sqlite3ext.h\
75 src
/3rdparty
/rapidxml.hpp\
99 debug
: CXXFLAGS
+= ${DEBUG}
100 ifneq ($(shell uname
),Linux
) # show console in Windows
101 debug
: LDFLAGS
+= -mconsole
106 ${CC} ${CFLAGS} ${OPT} -c
$< -o
$@
109 ${CXX} ${CXXFLAGS} ${OPT} -c
$< -o
$@
112 ${CXX} ${CXXFLAGS} ${OPT} ${OBJ} -o
${NAME} ${LDFLAGS}
115 rm -f src
/*.o src
/3rdparty
/*.o src
/gui
/*.o
${NAME} 2>/dev
/null