KissCount

KissCount Git Source Tree

Root/Makefile

1#ROOT_DIR="/usr"
2ROOT_DIR="."
3LIB_DIR=$(DESTDIR)$(ROOT_DIR)"/lib/kisscount/"
4SHARE_DIR=$(DESTDIR)$(ROOT_DIR)"/share/kisscount/"
5DOC_DIR=$(DESTDIR)$(ROOT_DIR)"/share/doc/kisscount/"
6BIN_DIR=$(DESTDIR)$(ROOT_DIR)"/bin/"
7
8CXX=$(HOST)g++
9KISSCOUNT=kc
10
11QT_PACKAGES="Qt5Core Qt5Gui Qt5Sql Qt5Xml Qt5Widgets"
12CXXFLAGS+=`pkg-config --cflags $(QT_PACKAGES)`
13CXXFLAGS+=-Wall -Isrc -Isrc/win32 -I${PWD}/lib/qt5charts/usr/include/x86_64-linux-gnu/qt5/ -L${PWD}/lib/qtcharts/lib/ -L${PWD}/lib/qt5charts/usr/lib/x86_64-linux-gnu/
14CXXFLAGS+=-Wall
15#-Dnullptr=0
16ifdef WIN32
17CXXFLAGS+=-DRESOURCES_ROOT="\"./resources/\"" -static
18else
19CXXFLAGS+=-DRESOURCES_ROOT="\"$(SHARE_DIR)\"" -ggdb -fPIC -O0
20# For developpers
21#CXXFLAGS+=-DRESOURCES_ROOT="\"./resources/\""
22endif
23
24SOURCES=$(shell find src -name '*.cpp' -type f | tr '\n' ' ')
25OBJS=$(SOURCES:.cpp=.o)
26MOC_HEADERS=$(shell find src/view -name '*.hpp' -type f | tr '\n' ' ')
27MOCS=$(MOC_HEADERS:.hpp=.objs)
28MOCS_OBJS=$(MOC_HEADERS:.hpp=.moc)
29
30#CXXFLAGS+=-Ilib/libkdchart/include -Ilib/libkdchart/src -Ilib/libkdchart/kdablibfakes/include
31#CXXFLAGS+=-DKDCHART_BUILD_KDCHART_LIB
32#KDCHART_SOURCES=$(shell find lib/libkdchart/src -name '*.cpp' -type f | tr '\n' ' ')
33#KDCHART_OBJS=$(KDCHART_SOURCES:.cpp=.o)
34#UI_CHARTSELECTOR=lib/libkdchart/src/ui_KDChartDatasetSelector.h
35#KDCHART_MOC_HEADERS=$(shell find lib/libkdchart/src -name '*.h' -type f | tr '\n' ' ')
36#KDCHART_MOCS=$(KDCHART_MOC_HEADERS:.h=.objs)
37#KDCHART_MOCS_OBJS=$(KDCHART_MOC_HEADERS:.h=.moc)
38#LDFLAGS+=lib/libkdchart.a
39
40ifndef WIN32
41LDFLAGS+=`pkg-config --libs $(QT_PACKAGES)`
42LDFLAGS+=-lofx -lQt5Charts
43else
44LDFLAGS+=lib_mingw_32/QtCore4.dll lib_mingw_32/QtGui4.dll lib_mingw_32/QtSql4.dll lib_mingw_32/QtXml4.dll
45endif
46
47all: mojito $(KISSCOUNT)
48
49clean_all: clean clean_libkdchart
50
51clean:
52find src -type f -name '*.o' -delete
53find src -type f -name '*~' -delete
54find src -type f -name '*.moc' -delete
55find src -type f -name '*.objs' -delete
56rm -f $(KISSCOUNT)
57
58%.o : %.cpp
59$(CXX) $(CXXFLAGS) -c $< -o $@
60
61%.objs : %.moc
62$(CXX) $(CXXFLAGS) -x c++ $< -c -o $@
63
64%.moc : %.hpp
65moc -nw $< -o $@
66
67%.moc : %.h
68moc -nw $< -o $@
69
70mojito : $(MOCS_OBJS)
71
72$(KISSCOUNT): $(MOCS) $(OBJS)
73$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
74
75# $(UI_CHARTSELECTOR): lib/libkdchart/src/KDChartDatasetSelector.ui
76# uic $< > $(UI_CHARTSELECTOR)
77# sed s/KDCHARTDATASETSELECTOR_H/UI_KDCHARTDATASETSELECTOR_H/g -i $(UI_CHARTSELECTOR)
78
79# lib/libkdchart.a: $(UI_CHARTSELECTOR) $(KDCHART_MOCS) $(KDCHART_OBJS)
80# $(HOST)ar rcu lib/libkdchart.a $(KDCHART_MOCS) $(KDCHART_OBJS)
81
82clean_libkdchart:
83rm -rf lib/libkdchart.a
84find lib/libkdchart -name '*.o' -delete
85find lib/libkdchart -type f -name '*.moc' -delete
86find lib/libkdchart -type f -name '*.objs' -delete
87
88generate_locales:
89./tools/generate_locales.sh
90
91ifdef WIN32
92package:
93./tools/package_win32.sh
94else
95package:
96./tools/package.sh
97endif
98
99install:
100mkdir -p $(BIN_DIR) $(SHARE_DIR) $(DOC_DIR)
101cp $(KISSCOUNT) $(BIN_DIR)
102cp -rf resources/* $(SHARE_DIR)
103rm -rf $(SHARE_DIR)/po/* # Only copy qm files
104cp -rf resources/po/*.qm $(SHARE_DIR)/po/
105cp -rf README* ChangeLog AUTHORS COPYING TODO $(DOC_DIR)
106
107remove:
108rm -rf $(LIB_DIR) $(SHARE_DIR) $(DOC_DIR) $(BIN_DIR)/kc
109
110uninstall: remove

Archive Download this file