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
-O0
-g
-ggdb3
13 WARNINGS
= -Wall
-Wno-vla
-Wno-long-long
-pedantic
15 LIBS
= -L
/usr
/local
/lib
-L
/lib
17 CURL_CFLAGS
= $(shell curl-config
--cflags)
18 CURL_LIBS
= $(shell curl-config
--libs
)
19 CURL_STATICLIBS
= $(shell curl-config
--libs
)
20 FLTK_CXXFLAGS
= $(shell fltk-config
--cxxflags)
21 FLTK_LIBS
= $(shell fltk-config
--use-images
--ldflags --libs
)
22 FLTK_STATICLIBS
= $(shell fltk-config
--use-images
--ldstaticflags
--libs
)
25 CXXFLAGS
= ${CURL_CFLAGS} ${INCLUDE} -std
=c
++11 ${WARNINGS} ${FLTK_CXXFLAGS}
26 LDFLAGS
= ${LIBS} ${FLTK_LIBS} ${FLTK_LIBS} -lstdc
++ -lz
${CURL_LIBS}
27 LDSTATICFLAGS
= ${LIBS} ${FLTK_STATICLIBS} ${CURL_STATICLIBS} -static-libgcc
-static-libstdc
++
31 # OS specific settings
32 ifeq ($(shell uname
), Linux
)
37 # -mwindows: dont use console for stdout/stderr
39 LDFLAGS
=${LDSTATICFLAGS} -mwindows
44 src
/3rdparty
/sqlite3.o\
58 src
/3rdparty
/sqlite3.c\
72 src
/3rdparty
/sqlite3.h\
73 src
/3rdparty
/sqlite3ext.h\
74 src
/3rdparty
/rapidxml.hpp\
97 debug
: CXXFLAGS
+= ${DEBUG}
98 ifneq ($(shell uname
),Linux
) # show console in Windows
99 debug
: LDFLAGS
+= -mconsole
104 ${CC} ${CFLAGS} -c
$< -o
$@
107 ${CXX} ${CXXFLAGS} -c
$< -o
$@
110 ${CXX} ${CXXFLAGS} ${OBJ} -o
${NAME} ${LDFLAGS}
113 rm -f src
/*.o src
/3rdparty
/*.o src
/gui
/*.o
${NAME} 2>/dev
/null