added romaji->katakana in advanced search
[aoi.git] / Makefile
blob0cc218207ac1b6d265e6bbd530aef375248f5373
1 # This Makefile should work under Linux and Mingw32 (in Windows) (needs GNU ld ?)
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 3.2 with -0x (x>0) has bug with -D_FORTIFY_SOURCE generates wrong code (slow fread in tinyxml)
12 # CLANG does not have -ggdb3
13 # http://llvm.org/bugs/show_bug.cgi?id=10276#c9
17 CXX = clang
18 CC = $(CXX)
19 DEBUG = -DDEBUG -O0 -g -ggdb3
20 WARNINGS = -Wall -Wno-vla -pedantic
22 LIBS = -L/usr/local/lib -L/lib
23 INCLUDE = -I/include
24 CURL_CFLAGS = $(shell curl-config --cflags)
25 CURL_LIBS = $(shell curl-config --libs)
26 CURL_STATICLIBS = $(shell curl-config --libs)
27 FLTK_CXXFLAGS = $(shell fltk-config --cxxflags)
28 FLTK_LIBS = $(shell fltk-config --use-images --ldflags --libs)
29 FLTK_STATICLIBS = $(shell fltk-config --use-images --ldstaticflags --libs)
31 CFLAGS = ${WARNINGS}
32 CXXFLAGS = ${CURL_CFLAGS} ${INCLUDE} -std=c++11 ${WARNINGS} ${FLTK_CXXFLAGS}
33 LDFLAGS = ${LIBS} ${FLTK_LIBS} ${FLTK_LIBS} -lstdc++ -lz ${CURL_LIBS}
34 LDSTATICFLAGS = ${LIBS} ${FLTK_STATICLIBS} ${CURL_STATICLIBS} -static-libgcc -static-libstdc++
36 NAME = aoi
38 # OS specific settings
39 ifeq ($(shell uname), Linux)
40 else # Windows
41 NAME=aoi.exe
42 CXX=g++ -DWINDOWS
43 CC=gcc
44 # -mwindows: dont use console for stdout/stderr
45 # -mconsole
46 LDFLAGS=${LDSTATICFLAGS} -mconsole
47 endif
50 OBJ=\
51 src/3rdparty/sqlite3.o\
52 src/config.o\
53 src/romanization.o\
54 src/aoi.o\
55 src/main.o\
56 src/utils.o\
57 src/parsers.o\
58 src/gui.o\
59 src/gui_widgets.o\
60 src/gui_dialogs.o\
61 src/gui_dicview.o\
62 src/gui_kanjiview.o
64 SRC=\
65 src/3rdparty/sqlite3.c\
66 src/config.cxx\
67 src/romanization.cxx\
68 src/aoi.cxx\
69 src/main.cxx\
70 src/utils.cxx\
71 src/parsers.cxx\
72 src/gui.cxx\
73 src/gui_widgets.cxx\
74 src/gui_dialogs.cxx\
75 src/gui_dicview.cxx\
76 src/gui_kanjiview.cxx
78 HEAD=\
79 src/3rdparty/sqlite3.h\
80 src/3rdparty/sqlite3ext.h\
81 src/3rdparty/rapidxml.hpp\
82 src/logger.hxx\
83 src/sqlite3.hxx\
84 src/config.hxx\
85 src/datatypes.hxx\
86 src/romanization.hxx\
87 src/utils.hxx\
88 src/parsers.hxx\
89 src/aoi.hxx\
90 src/gui_settings.hxx\
91 src/gui_widgets.hxx\
92 src/gui_dialogs.hxx\
93 src/gui.hxx\
94 src/gui_dicview.hxx\
95 src/gui_kanjiview.hxx
97 build: ${NAME}
99 %.o: %.c
100 ${CC} ${CFLAGS} -c $< -o $@
102 %.o: %.cxx
103 ${CXX} ${CXXFLAGS} ${DEBUG} -c $< -o $@
105 ${NAME}: ${OBJ}
106 ${CXX} ${CXXFLAGS} ${DEBUG} ${OBJ} -o ${NAME} ${LDFLAGS}
108 strip:
109 strip -s ${NAME}
111 clean:
112 rm -f src/*.o src/3rdparty/*.o src/gui/*.o ${NAME} 2>/dev/null
114 ${OBJ}: ${HEAD}
116 distro: clean ${NAME} strip