jlpt and grade added as kanjisearch filters
[aoi.git] / Makefile
blob251d125d3d31429cdde26d146312bb5c149a76d0
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
8 #
9 # http://tehsausage.com/mingw-to-string
11 # CLANG does not have -ggdb3
15 CXX = clang
16 CC = $(CXX)
17 DEBUG = -DDEBUG -O0 -g -ggdb3
18 WARNINGS = -Wall -Wno-vla -pedantic
20 LIBS = -L/usr/local/lib -L/lib
21 INCLUDE = -I/include
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)
29 CFLAGS = ${WARNINGS}
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++
34 NAME = aoi
36 # OS specific settings
37 ifeq ($(shell uname), Linux)
38 else # Windows
39 NAME=aoi.exe
40 CXX=g++ -DWINDOWS
41 CC=gcc
42 # -mwindows: dont use console for stdout/stderr
43 # -mconsole
44 LDFLAGS=${LDSTATICFLAGS} -mconsole
45 endif
48 OBJ=\
49 src/3rdparty/sqlite3.o\
50 src/config.o\
51 src/romanization.o\
52 src/aoi.o\
53 src/main.o\
54 src/utils.o\
55 src/parsers.o\
56 src/gui.o\
57 src/gui_widgets.o\
58 src/gui_dialogs.o\
59 src/gui_dicview.o\
60 src/gui_kanjiview.o
62 SRC=\
63 src/3rdparty/sqlite3.c\
64 src/config.cxx\
65 src/romanization.cxx\
66 src/aoi.cxx\
67 src/main.cxx\
68 src/utils.cxx\
69 src/parsers.cxx\
70 src/gui.cxx\
71 src/gui_widgets.cxx\
72 src/gui_dialogs.cxx\
73 src/gui_dicview.cxx\
74 src/gui_kanjiview.cxx
76 HEAD=\
77 src/3rdparty/sqlite3.h\
78 src/3rdparty/sqlite3ext.h\
79 src/3rdparty/rapidxml.hpp\
80 src/logger.hxx\
81 src/sqlite3.hxx\
82 src/config.hxx\
83 src/datatypes.hxx\
84 src/romanization.hxx\
85 src/utils.hxx\
86 src/parsers.hxx\
87 src/aoi.hxx\
88 src/gui_settings.hxx\
89 src/gui_widgets.hxx\
90 src/gui_dialogs.hxx\
91 src/gui.hxx\
92 src/gui_dicview.hxx\
93 src/gui_kanjiview.hxx
95 build: ${NAME}
97 %.o: %.c
98 ${CC} ${CFLAGS} -c $< -o $@
100 %.o: %.cxx
101 ${CXX} ${CXXFLAGS} ${DEBUG} -c $< -o $@
103 ${NAME}: ${OBJ}
104 ${CXX} ${CXXFLAGS} ${DEBUG} ${OBJ} -o ${NAME} ${LDFLAGS}
106 strip:
107 strip -s ${NAME}
109 clean:
110 rm -f src/*.o src/3rdparty/*.o src/gui/*.o ${NAME} 2>/dev/null
112 ${OBJ}: ${HEAD}
114 distro: clean ${NAME} strip