94 lines
2.6 KiB
Makefile
94 lines
2.6 KiB
Makefile
ROOT_DIR="/usr/local"
|
|
#LIB_DIR=$(DESTDIR)$(ROOT_DIR)"/lib/kisscount/"
|
|
SHARE_DIR=$(DESTDIR)$(ROOT_DIR)"/share/kisscount/"
|
|
DOC_DIR=$(DESTDIR)$(ROOT_DIR)"/share/doc/kisscount/"
|
|
BIN_DIR=$(DESTDIR)$(ROOT_DIR)"/bin/"
|
|
|
|
QT_PACKAGES="QtCore QtGui QtSql"
|
|
CXXFLAGS=`pkg-config --cflags $(QT_PACKAGES)` -Wall -Isrc -ggdb -fPIC
|
|
CXXFLAGS+=-I/usr/include/libxml2
|
|
CXXFLAGS+=-DRESSOURCES_ROOT="\"$(SHARE_DIR)\""
|
|
# For developpers
|
|
#CXXFLAGS+=-DRESSOURCES_ROOT="\"./ressources/\""
|
|
|
|
LDFLAGS=`pkg-config --libs $(QT_PACKAGES)`
|
|
LDFLAGS+=-lofx
|
|
LDFLAGS+=-lxml2
|
|
|
|
CXX=$(HOST)g++
|
|
|
|
SOURCES=$(shell find src -name '*.cpp' -type f | tr '\n' ' ')
|
|
OBJS=$(SOURCES:.cpp=.o)
|
|
MOC_HEADERS=$(shell find src/view -name '*.hpp' -type f | tr '\n' ' ')
|
|
MOCS=$(MOC_HEADERS:.hpp=.objs)
|
|
MOCS_OBJS=$(MOC_HEADERS:.hpp=.moc)
|
|
|
|
CXXFLAGS+=-Ilibkdchart/include -Ilibkdchart/src -Ilibkdchart/kdablibfakes/include
|
|
CXXFLAGS+=-DKDCHART_BUILD_KDCHART_LIB
|
|
KDCHART_SOURCES=$(shell find libkdchart/src -name '*.cpp' -type f | tr '\n' ' ')
|
|
KDCHART_OBJS=$(KDCHART_SOURCES:.cpp=.o)
|
|
UI_CHARTSELECTOR=libkdchart/src/ui_KDChartDatasetSelector.h
|
|
KDCHART_MOC_HEADERS=$(shell find libkdchart/src -name '*.h' -type f | tr '\n' ' ')
|
|
KDCHART_MOCS=$(KDCHART_MOC_HEADERS:.h=.objs)
|
|
KDCHART_MOCS_OBJS=$(KDCHART_MOC_HEADERS:.h=.moc)
|
|
LDFLAGS+=libkdchart.a
|
|
|
|
all: mojito libkdchart.a kc
|
|
|
|
clean: clean_libkdchart
|
|
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
|
|
rm -f kc
|
|
|
|
%.o : %.cpp
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
%.objs : %.moc
|
|
$(CXX) $(CXXFLAGS) -x c++ $< -c -o $@
|
|
|
|
%.moc : %.hpp
|
|
moc -nw $< -o $@
|
|
|
|
%.moc : %.h
|
|
moc -nw $< -o $@
|
|
|
|
mojito : $(MOCS_OBJS) $(KDCHART_MOCS_OBJS)
|
|
|
|
kc: $(MOCS) $(OBJS)
|
|
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) #-L. -lkdchart
|
|
|
|
$(UI_CHARTSELECTOR): libkdchart/src/KDChartDatasetSelector.ui
|
|
uic $< > $(UI_CHARTSELECTOR)
|
|
sed s/KDCHARTDATASETSELECTOR_H/UI_KDCHARTDATASETSELECTOR_H/g -i $(UI_CHARTSELECTOR)
|
|
|
|
libkdchart.a: $(UI_CHARTSELECTOR) $(KDCHART_MOCS) $(KDCHART_OBJS)
|
|
ar rcu libkdchart.a $(KDCHART_MOCS) $(KDCHART_OBJS)
|
|
|
|
clean_libkdchart:
|
|
rm -rf libkdchart.a
|
|
find libkdchart -name '*.o' -delete
|
|
find libkdchart -type f -name '*.moc' -delete
|
|
find libkdchart -type f -name '*.objs' -delete
|
|
|
|
generate_locales:
|
|
./tools/generate_locales.sh
|
|
|
|
ifdef WIN32
|
|
package:
|
|
./tools/package_win32.sh
|
|
else
|
|
package:
|
|
./tools/package.sh
|
|
endif
|
|
|
|
install:
|
|
mkdir -p $(BIN_DIR) $(SHARE_DIR) $(DOC_DIR)
|
|
cp kc $(BIN_DIR)
|
|
cp -rf ressources/* $(SHARE_DIR)
|
|
cp -rf README* ChangeLog CONTRIBUTORS COPYING TODO $(DOC_DIR)
|
|
|
|
remove:
|
|
rm -rf $(LIB_DIR) $(SHARE_DIR) $(DOC_DIR) $(BIN_DIR)/kc
|