2012-02-28 09:34:33 +01:00
|
|
|
ROOT_DIR="/usr"
|
|
|
|
LIB_DIR=$(DESTDIR)$(ROOT_DIR)"/lib/kisscount/"
|
2011-08-09 17:55:46 +02:00
|
|
|
SHARE_DIR=$(DESTDIR)$(ROOT_DIR)"/share/kisscount/"
|
|
|
|
DOC_DIR=$(DESTDIR)$(ROOT_DIR)"/share/doc/kisscount/"
|
|
|
|
BIN_DIR=$(DESTDIR)$(ROOT_DIR)"/bin/"
|
2011-03-06 17:20:42 +01:00
|
|
|
|
2014-10-23 21:06:27 +02:00
|
|
|
CXX=$(HOST)g++
|
|
|
|
KISSCOUNT=kc
|
|
|
|
|
2012-02-19 17:14:36 +01:00
|
|
|
QT_PACKAGES="QtCore QtGui QtSql QtXml"
|
2012-02-28 16:11:22 +01:00
|
|
|
CXXFLAGS+=`pkg-config --cflags $(QT_PACKAGES)`
|
2014-10-23 21:06:27 +02:00
|
|
|
CXXFLAGS+=-Wall -Isrc -Isrc/win32
|
2012-03-04 18:17:43 +01:00
|
|
|
ifdef WIN32
|
2015-06-20 18:22:51 +02:00
|
|
|
CXXFLAGS+=-DRESOURCES_ROOT="\"./resources/\"" -static
|
2012-03-04 18:17:43 +01:00
|
|
|
else
|
2015-06-20 18:22:51 +02:00
|
|
|
CXXFLAGS+=-DRESOURCES_ROOT="\"$(SHARE_DIR)\"" -ggdb -fPIC
|
2011-03-23 20:35:29 +01:00
|
|
|
# For developpers
|
2015-06-20 18:22:51 +02:00
|
|
|
#CXXFLAGS+=-DRESOURCES_ROOT="\"./resources/\""
|
2012-03-04 18:17:43 +01:00
|
|
|
endif
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2011-03-13 19:15:21 +01:00
|
|
|
SOURCES=$(shell find src -name '*.cpp' -type f | tr '\n' ' ')
|
2010-05-15 12:05:39 +02:00
|
|
|
OBJS=$(SOURCES:.cpp=.o)
|
2011-09-03 20:40:21 +02:00
|
|
|
MOC_HEADERS=$(shell find src/view -name '*.hpp' -type f | tr '\n' ' ')
|
|
|
|
MOCS=$(MOC_HEADERS:.hpp=.objs)
|
|
|
|
MOCS_OBJS=$(MOC_HEADERS:.hpp=.moc)
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2012-02-11 14:34:29 +01:00
|
|
|
CXXFLAGS+=-Ilib/libkdchart/include -Ilib/libkdchart/src -Ilib/libkdchart/kdablibfakes/include
|
2012-05-31 21:33:43 +02:00
|
|
|
CXXFLAGS+=-DKDCHART_BUILD_KDCHART_LIB
|
2012-02-11 14:34:29 +01:00
|
|
|
KDCHART_SOURCES=$(shell find lib/libkdchart/src -name '*.cpp' -type f | tr '\n' ' ')
|
2012-01-28 15:53:58 +01:00
|
|
|
KDCHART_OBJS=$(KDCHART_SOURCES:.cpp=.o)
|
2012-02-11 14:34:29 +01:00
|
|
|
UI_CHARTSELECTOR=lib/libkdchart/src/ui_KDChartDatasetSelector.h
|
|
|
|
KDCHART_MOC_HEADERS=$(shell find lib/libkdchart/src -name '*.h' -type f | tr '\n' ' ')
|
2012-01-28 15:53:58 +01:00
|
|
|
KDCHART_MOCS=$(KDCHART_MOC_HEADERS:.h=.objs)
|
|
|
|
KDCHART_MOCS_OBJS=$(KDCHART_MOC_HEADERS:.h=.moc)
|
2012-02-11 14:34:29 +01:00
|
|
|
LDFLAGS+=lib/libkdchart.a
|
2012-01-28 15:53:58 +01:00
|
|
|
|
2014-10-23 21:06:27 +02:00
|
|
|
ifndef WIN32
|
|
|
|
LDFLAGS+=`pkg-config --libs $(QT_PACKAGES)`
|
|
|
|
LDFLAGS+=-lofx
|
|
|
|
else
|
2015-06-20 18:22:51 +02:00
|
|
|
LDFLAGS+=lib_mingw_32/QtCore4.dll lib_mingw_32/QtGui4.dll lib_mingw_32/QtSql4.dll lib_mingw_32/QtXml4.dll
|
2014-10-23 21:06:27 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
all: mojito lib/libkdchart.a $(KISSCOUNT)
|
2012-01-28 15:53:58 +01:00
|
|
|
|
2012-02-28 17:42:47 +01:00
|
|
|
clean_all: clean clean_libkdchart
|
2012-01-29 11:34:52 +01:00
|
|
|
|
2012-02-28 17:42:47 +01:00
|
|
|
clean:
|
2012-01-28 15:53:58 +01:00
|
|
|
find src -type f -name '*.o' -delete
|
|
|
|
find src -type f -name '*~' -delete
|
|
|
|
find src -type f -name '*.moc' -delete
|
|
|
|
find src -type f -name '*.objs' -delete
|
2014-10-23 21:06:27 +02:00
|
|
|
rm -f $(KISSCOUNT)
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2011-09-03 20:40:21 +02:00
|
|
|
%.o : %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
%.objs : %.moc
|
|
|
|
$(CXX) $(CXXFLAGS) -x c++ $< -c -o $@
|
|
|
|
|
|
|
|
%.moc : %.hpp
|
|
|
|
moc -nw $< -o $@
|
|
|
|
|
2012-01-28 15:53:58 +01:00
|
|
|
%.moc : %.h
|
|
|
|
moc -nw $< -o $@
|
2010-12-11 09:51:44 +01:00
|
|
|
|
2012-01-28 15:53:58 +01:00
|
|
|
mojito : $(MOCS_OBJS) $(KDCHART_MOCS_OBJS)
|
2011-09-03 10:38:36 +02:00
|
|
|
|
2014-10-23 21:06:27 +02:00
|
|
|
$(KISSCOUNT): $(MOCS) $(OBJS)
|
2012-01-30 20:54:04 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
|
2012-01-28 15:53:58 +01:00
|
|
|
|
2012-02-11 14:34:29 +01:00
|
|
|
$(UI_CHARTSELECTOR): lib/libkdchart/src/KDChartDatasetSelector.ui
|
2012-01-28 15:53:58 +01:00
|
|
|
uic $< > $(UI_CHARTSELECTOR)
|
|
|
|
sed s/KDCHARTDATASETSELECTOR_H/UI_KDCHARTDATASETSELECTOR_H/g -i $(UI_CHARTSELECTOR)
|
|
|
|
|
2012-02-11 14:34:29 +01:00
|
|
|
lib/libkdchart.a: $(UI_CHARTSELECTOR) $(KDCHART_MOCS) $(KDCHART_OBJS)
|
2012-02-28 17:42:47 +01:00
|
|
|
$(HOST)ar rcu lib/libkdchart.a $(KDCHART_MOCS) $(KDCHART_OBJS)
|
2012-01-28 15:53:58 +01:00
|
|
|
|
|
|
|
clean_libkdchart:
|
2012-02-11 14:34:29 +01:00
|
|
|
rm -rf lib/libkdchart.a
|
|
|
|
find lib/libkdchart -name '*.o' -delete
|
|
|
|
find lib/libkdchart -type f -name '*.moc' -delete
|
|
|
|
find lib/libkdchart -type f -name '*.objs' -delete
|
2010-07-04 19:39:39 +02:00
|
|
|
|
2011-01-25 20:26:29 +01:00
|
|
|
generate_locales:
|
|
|
|
./tools/generate_locales.sh
|
|
|
|
|
2011-02-05 21:02:03 +01:00
|
|
|
ifdef WIN32
|
|
|
|
package:
|
|
|
|
./tools/package_win32.sh
|
|
|
|
else
|
2011-01-25 20:26:29 +01:00
|
|
|
package:
|
|
|
|
./tools/package.sh
|
2011-03-05 12:26:35 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
install:
|
2011-09-03 10:38:36 +02:00
|
|
|
mkdir -p $(BIN_DIR) $(SHARE_DIR) $(DOC_DIR)
|
2014-10-23 21:06:27 +02:00
|
|
|
cp $(KISSCOUNT) $(BIN_DIR)
|
2015-06-20 18:22:51 +02:00
|
|
|
cp -rf resources/* $(SHARE_DIR)
|
2012-06-12 16:10:18 +02:00
|
|
|
rm -rf $(SHARE_DIR)/po/* # Only copy qm files
|
2015-06-20 18:22:51 +02:00
|
|
|
cp -rf resources/po/*.qm $(SHARE_DIR)/po/
|
2012-06-10 17:07:51 +02:00
|
|
|
cp -rf README* ChangeLog AUTHORS COPYING TODO $(DOC_DIR)
|
2011-03-06 17:20:42 +01:00
|
|
|
|
|
|
|
remove:
|
|
|
|
rm -rf $(LIB_DIR) $(SHARE_DIR) $(DOC_DIR) $(BIN_DIR)/kc
|
2012-06-01 21:36:58 +02:00
|
|
|
|
2012-06-12 16:10:18 +02:00
|
|
|
uninstall: remove
|