removed x11 color names
[aoi.git] / Makefile
blobb8a897f099933f70771394f2b2449e3887dca3b0
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
10 CXX = clang
11 CC = $(CXX)
12 DEBUG = -DDEBUG -O0 -g -ggdb3
13 WARNINGS = -Wall -Wno-vla -pedantic
15 LIBS = -L/usr/local/lib -L/lib
16 INCLUDE = -I/include
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)
24 CFLAGS = ${WARNINGS}
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++
29 NAME = aoi
31 # OS specific settings
32 ifeq ($(shell uname), Linux)
33 else # Windows
34 NAME=aoi.exe
35 CXX=g++ -DWINDOWS
36 CC=gcc
37 # -mwindows: dont use console for stdout/stderr
38 # -mconsole
39 LDFLAGS=${LDSTATICFLAGS} -mconsole
40 endif
43 OBJ=\
44 src/3rdparty/sqlite3.o\
45 src/config.o\
46 src/romanization.o\
47 src/aoi.o\
48 src/main.o\
49 src/utils.o\
50 src/parsers.o\
51 src/gui.o\
52 src/gui_widgets.o\
53 src/gui_dialogs.o\
54 src/gui_dicview.o\
55 src/gui_kanjiview.o
57 SRC=\
58 src/3rdparty/sqlite3.c\
59 src/config.cxx\
60 src/romanization.cxx\
61 src/aoi.cxx\
62 src/main.cxx\
63 src/utils.cxx\
64 src/parsers.cxx\
65 src/gui.cxx\
66 src/gui_widgets.cxx\
67 src/gui_dialogs.cxx\
68 src/gui_dicview.cxx\
69 src/gui_kanjiview.cxx
71 HEAD=\
72 src/3rdparty/sqlite3.h\
73 src/3rdparty/sqlite3ext.h\
74 src/3rdparty/rapidxml.hpp\
75 src/logger.hxx\
76 src/sqlite3.hxx\
77 src/config.hxx\
78 src/datatypes.hxx\
79 src/romanization.hxx\
80 src/utils.hxx\
81 src/parsers.hxx\
82 src/aoi.hxx\
83 src/gui_settings.hxx\
84 src/gui_widgets.hxx\
85 src/gui_dialogs.hxx\
86 src/gui.hxx\
87 src/gui_dicview.hxx\
88 src/gui_kanjiview.hxx
90 build: ${NAME}
92 %.o: %.c
93 ${CC} ${CFLAGS} -c $< -o $@
95 %.o: %.cxx
96 ${CXX} ${CXXFLAGS} ${DEBUG} -c $< -o $@
98 ${NAME}: ${OBJ}
99 ${CXX} ${CXXFLAGS} ${DEBUG} ${OBJ} -o ${NAME} ${LDFLAGS}
101 strip:
102 strip -s ${NAME}
104 clean:
105 rm -f src/*.o src/3rdparty/*.o src/gui/*.o ${NAME} 2>/dev/null
107 ${OBJ}: ${HEAD}
109 distro: clean ${NAME} strip