2011-08-09 17:55:46 +02:00
|
|
|
ROOT_DIR="/usr/local"
|
2011-09-03 10:38:36 +02:00
|
|
|
#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
|
|
|
|
2011-09-03 10:38:36 +02:00
|
|
|
QT_PACKAGES="QtCore QtGui QtSql"
|
|
|
|
CXXFLAGS=`pkg-config --cflags $(QT_PACKAGES)` -Wall -Isrc -ggdb
|
2011-08-27 18:35:36 +02:00
|
|
|
CXXFLAGS+=-I/usr/include/libxml2
|
2011-07-26 20:23:13 +02:00
|
|
|
CXXFLAGS+=-DRESSOURCES_ROOT="\"$(SHARE_DIR)\""
|
2011-03-23 20:35:29 +01:00
|
|
|
# For developpers
|
2011-07-26 20:23:13 +02:00
|
|
|
#CXXFLAGS+=-DRESSOURCES_ROOT="\"./ressources/\""
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2011-09-03 10:38:36 +02:00
|
|
|
LDFLAGS=`pkg-config --libs $(QT_PACKAGES)`
|
2011-03-13 19:15:21 +01:00
|
|
|
LDFLAGS+=-lofx
|
2011-08-27 18:35:36 +02:00
|
|
|
LDFLAGS+=-lxml2
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2011-04-24 12:39:40 +02:00
|
|
|
CXX=$(HOST)g++
|
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
|
|
|
|
2011-09-03 20:40:21 +02:00
|
|
|
all: mojito kc
|
2010-05-14 15:04:01 +02:00
|
|
|
|
|
|
|
clean:
|
2011-10-20 11:11:59 +02:00
|
|
|
find src -type f -name '*.o' -exec rm -f \{\} \;
|
|
|
|
find src -type f -name '*~' -exec rm -f \{\} \;
|
2011-09-03 10:38:36 +02:00
|
|
|
find src -type f -name '*.moc' -exec rm -f \{\} \;
|
2011-09-03 20:40:21 +02:00
|
|
|
find src -type f -name '*.objs' -exec rm -f \{\} \;
|
2011-03-13 19:15:21 +01:00
|
|
|
rm -f kc
|
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 $@
|
|
|
|
|
|
|
|
mojito : $(MOCS_OBJS)
|
2010-12-11 09:51:44 +01:00
|
|
|
|
2011-09-03 10:38:36 +02:00
|
|
|
|
2011-09-03 20:40:21 +02:00
|
|
|
kc: $(MOCS) $(OBJS)
|
2010-07-04 19:39:39 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
|
|
|
|
|
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)
|
2011-03-06 17:20:42 +01:00
|
|
|
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
|