-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.common
65 lines (48 loc) · 1.36 KB
/
Makefile.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# general rules needed (nearly) all the time
QTDIR = /usr/share/qt4
CC = gcc
DC = gdc
QT_MOC = $(QTDIR)/bin/moc
QT_INCLUDE = $(QTDIR)/include
QT_LIB = $(QTDIR)/lib
PROJDIR = ~/devel/projects
DISTDIR = $(PROJDIR)/distrib
ARCH = -march=native # -mfpmath=sse -msse -msse2 # buggy??
# how to make a lib from objects
%.a :
$(AR) crs $@ $?
# how to make an object from source
%.o : %.cc
$(CC) $(CFLAGS) $(IFLAGS) $(DGCCVER) -c $< -o $@
%.o : %.cpp
$(CC) $(CFLAGS) $(IFLAGS) $(DGCCVER) -c $< -o $@
%.o : %.d
$(CC) $(CFLAGS) $(IFLAGS) -c $< -o $@
# for mocs
%.moc.o : %.moc
$(CC) $(CFLAGS) $(IFLAGS) $(DGCCVER) -x c++ -c $< -o $@
%.moc : %.h
$(QT_MOC) $< -o $@
# the default target
# generate the executable from all objects
# variables have to be defined individually
$(TARGET) : $(OBJECTS)
$(CC) -o $@ $(LFLAGS) $(DGCCVER) $^ $(LIBS) $(GUI_LIBS)
new : all_clean
$(MAKE) $(TARGET)
depend :
$(CC) -MM $(DEP_OPTS) $(DEP_SRC) > Makefile.dep
tags : $(SOURCE)
ctags $(SOURCE)
edit :
$(EDIT) $(SOURCE) &
distrib : all_clean
tar -C .. -czvf $(DIRECTORY).tgz $(DIRECTORY); mv \
$(DIRECTORY).tgz $(DISTDIR)/.
undistrib :
cd $(PROJDIR); tar -xzvf $(DISTDIR)/$(DIRECTORY).tgz
version :
echo "#define PROGRAM_VERSION " "\""`date +%x-%T`"\"" > version.h
docs : .doc_generated
.doc_generated : $(DOC_SOURCE)
doxygen Doxyfile; ( $(DOC_INSTALL) ); touch .doc_generated