Add time remind
[FreeRecite.git] / src / Makefile
bloba2ff5ceb42f94754bbd94e3798e3abc12a2dcbff
1 #############################################################################
2 # Makefile for building: FreeRecite
3 # Author1: Kermit Mei<kermit.mei@gmail.com>
4 # Author2: Jianjun Kong <kongjianjun@gmail.com>
5 # Template: app
6 # Target: FreeRecite
7 #############################################################################
9 ####### Compiler, tools and options
11 CC = gcc
12 CXX = g++
13 CFLAGS = -pipe -O2 -Wall -W $(DEFINES)
14 CXXFLAGS = -pipe -O2 -Wall -W $(DEFINES)
15 INCPATH = -I.
16 LINK = g++
17 LFLAGS = -Wl
18 LIBS = $(SUBLIBS)
19 AR = ar cqs
20 TAR = tar -cf
21 COMPRESS = gzip -9f
22 COPY = cp -f
23 SED = sed
24 COPY_FILE = $(COPY)
25 COPY_DIR = $(COPY) -r
26 INSTALL_FILE = install -m 644 -p
27 INSTALL_DIR = $(COPY_DIR)
28 INSTALL_PROGRAM = install -m 755 -p
29 DEL_FILE = rm -f
30 SYMLINK = ln -sf
31 DEL_DIR = rm -rf
32 MOVE = mv -f
33 CHK_DIR_EXISTS= test -d
34 MKDIR = mkdir -p
36 ####### Output directory
38 OBJECTS_DIR = ./
40 ####### Files
42 SOURCES = Cui.cpp \
43 Dict.cpp \
44 DictItem.cpp \
45 ForgetCurve.cpp \
46 main.cpp \
47 Manager.cpp \
48 Reciter.cpp \
49 Task.cpp \
50 WordList.cpp
51 OBJECTS = Cui.o \
52 Dict.o \
53 DictItem.o \
54 ForgetCurve.o \
55 main.o \
56 Manager.o \
57 Reciter.o \
58 Task.o \
59 WordList.o
61 TARGET = FreeRecite
63 ####### Implicit rules
65 .SUFFIXES: .o .c .cpp .cc .cxx .C
67 .cpp.o:
68 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
70 .cc.o:
71 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
73 .cxx.o:
74 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
76 .C.o:
77 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
79 .c.o:
80 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
82 ####### Build rules
84 $(TARGET): $(OBJECTS)
85 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
87 clean:
88 -$(DEL_FILE) $(OBJECTS)
89 -$(DEL_FILE) *~ core *.core $(TARGET)
91 ####### Compile
93 Cui.o: Cui.cpp Cui.h \
94 Manager.h \
95 Task.h \
96 Dict.h \
97 DictItem.h \
98 Reciter.h \
99 WordList.h
100 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Cui.o Cui.cpp
102 Dict.o: Dict.cpp Dict.h \
103 DictItem.h
104 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Dict.o Dict.cpp
106 DictItem.o: DictItem.cpp DictItem.h
107 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o DictItem.o DictItem.cpp
109 ForgetCurve.o: ForgetCurve.cpp ForgetCurve.h
110 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ForgetCurve.o ForgetCurve.cpp
112 main.o: main.cpp Cui.h
113 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
115 Manager.o: Manager.cpp Manager.h \
116 Task.h \
117 ForgetCurve.h
118 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Manager.o Manager.cpp
120 Reciter.o: Reciter.cpp Reciter.h \
121 WordList.h
122 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Reciter.o Reciter.cpp
124 Task.o: Task.cpp Task.h \
125 ForgetCurve.h
126 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Task.o Task.cpp
128 WordList.o: WordList.cpp WordList.h
129 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o WordList.o WordList.cpp
131 ####### Install
133 install:
134 $(MKDIR) ~/.FreeRecite/
135 $(COPY_DIR) ../dict/FreeRecite/* ~/.FreeRecite/
136 $(COPY_DIR) ../doc ~/.FreeRecite/
137 sudo $(INSTALL_PROGRAM) ./FreeRecite /usr/bin/
139 uninstall:
140 $(DEL_DIR) ~/.FreeRecite/
141 sudo $(DEL_FILE) /usr/bin/FreeRecite