annotate Makefile.gen @ 299:3dc88d3814b3

Rename some Makefile variables.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 11 May 2023 13:07:05 +0300
parents 47ecb4b14e3e
children 52f0da883469
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
1 ###
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
2 ### Compiler flags
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
3 ###
267
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
4 CFLAGS += -W -Wall -Wextra
291
bc6767398eec Change from -std=c++11 to c++17 in preparation for Qt6.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
5 CXXFLAGS += -W -Wall -Wextra -std=c++17
267
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
6
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
7 ifneq ($(ASAN),)
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
8 XCFLAGS = -fsanitize=address
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
9 LDFLAGS += -lasan
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
10 else
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
11 XCFLAGS = -O2
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
12 endif
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
13
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
14 CFLAGS += $(XCFLAGS)
2400c2fac4b1 Add Makefile option for building with ASAN.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
15 CXXFLAGS += $(XCFLAGS)
184
87dfca9f704d Move optimization and warning CFLAGS and CXXFLAGS to Makefile.gen
Matti Hamalainen <ccr@tnsp.org>
parents: 157
diff changeset
16
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
17
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
18 ###
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
19 ### Tools, paths and directories
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
20 ###
208
e6a2658ae096 Enable building via clang++ (tested with 5.0).
Matti Hamalainen <ccr@tnsp.org>
parents: 192
diff changeset
21 ifneq ($(BINTOOL_PREFIX),)
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 CC = $(BINTOOL_PREFIX)gcc
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 CXX = $(BINTOOL_PREFIX)g++
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 AR = $(BINTOOL_PREFIX)ar
208
e6a2658ae096 Enable building via clang++ (tested with 5.0).
Matti Hamalainen <ccr@tnsp.org>
parents: 192
diff changeset
25 endif
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 RANLIB = $(BINTOOL_PREFIX)ranlib
49
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
27 WINDRES = $(BINTOOL_PREFIX)windres
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
28
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
29
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 INSTALL ?= install
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 MKDIR ?= mkdir
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 MKDIR_P ?= $(MKDIR) -p
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
290
755fe3f8c08f Minor build system cleanups in preparation for Qt6 support.
Matti Hamalainen <ccr@tnsp.org>
parents: 279
diff changeset
34 # Qt tools
755fe3f8c08f Minor build system cleanups in preparation for Qt6 support.
Matti Hamalainen <ccr@tnsp.org>
parents: 279
diff changeset
35 QT_RCC = $(QT_TOOL_PREFIX)rcc
755fe3f8c08f Minor build system cleanups in preparation for Qt6 support.
Matti Hamalainen <ccr@tnsp.org>
parents: 279
diff changeset
36 QT_MOC = $(QT_TOOL_PREFIX)moc
755fe3f8c08f Minor build system cleanups in preparation for Qt6 support.
Matti Hamalainen <ccr@tnsp.org>
parents: 279
diff changeset
37 QT_UIC = $(QT_TOOL_PREFIX)uic
755fe3f8c08f Minor build system cleanups in preparation for Qt6 support.
Matti Hamalainen <ccr@tnsp.org>
parents: 279
diff changeset
38
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
39
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
40 ###
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
41 ### Main targets and objects
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
42 ###
299
3dc88d3814b3 Rename some Makefile variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 292
diff changeset
43 QT_FLAGS += -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG \
234
4a993456df9f Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 233
diff changeset
44 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB \
4a993456df9f Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 233
diff changeset
45 -DQT_CORE_LIB
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
47 # Application stuff
80
c8fd927cd2c4 Restructure the project by placing source code, images into appropriate
Matti Hamalainen <ccr@tnsp.org>
parents: 76
diff changeset
48 APP_IMG=img/
263
f0e180b13e05 More build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 262
diff changeset
49 APP_BIN=$(BINPATH)Syntilista$(BINEXT)
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
50
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
51 APP_HDRS=\
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
52 src/main.h \
246
43a5e09bb832 Split some utility functions to util.{h,cpp}
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
53 src/util.h \
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
54 src/ui_viewtransactions.h \
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
55 src/ui_mainwindow.h \
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
56 src/ui_editperson.h \
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
57 src/ui_aboutwindow.h
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
58
237
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
59 APP_OBJS=\
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
60 main.o \
246
43a5e09bb832 Split some utility functions to util.{h,cpp}
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
61 util.o \
237
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
62 editperson.o \
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
63 viewtransactions.o \
242
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents: 238
diff changeset
64 aboutwindow.o \
237
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
65 sqlmodels.o \
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
66 printing.o \
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
67 resources.o \
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
68 moc_main.o \
54ab3f3e28c0 Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents: 234
diff changeset
69 runguard.o
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 LOGO_SVG ?= kampuscafe4.svg
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
72 LOGO_SRC_PNG ?= CafeKampus_logo_FINAL_RGB.png
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
73
52
1ac8fdd932b3 More work on build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
74 ICON_PNGS = icon-64.png icon-48.png icon-32.png icon-16.png
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
75 LOGO_PNG = logo.png
279
770d1ea07a49 Add LOGO_SIZE Makefile variable.
Matti Hamalainen <ccr@tnsp.org>
parents: 275
diff changeset
76 LOGO_SIZE = 256
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
78 APP_RESOURCES += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS)) \
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
79 COPYING.html
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
80
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
81 DISTCLEAN_TARGETS += $(addprefix $(APP_IMG),$(LOGO_PNG) $(ICON_PNGS))
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
82
56
ac3daf42f781 Rename some files.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
83
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
84 # And target lists
49
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
85 TARGETS = $(APP_BIN)
258
daaad6ad8212 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 246
diff changeset
86 NOBUILD_TARGETS +=
81
810ca71af506 Improve 'clean' target handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 80
diff changeset
87 NOINST_TARGETS +=
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
88 CLEAN_TARGETS += icon.ico src/moc_*.cpp src/ui_*.h
81
810ca71af506 Improve 'clean' target handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 80
diff changeset
89 DISTCLEAN_TARGETS +=
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
92 # Version
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
93 APP_VERSION := $(shell cat VERSION)
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
94 comma:= ,
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
95 APP_VERSION_COM := $(subst .,$(comma),$(APP_VERSION))
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
96 CXXFLAGS += -DAPP_VERSION=\"$(APP_VERSION)\"
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
97
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
98
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
99 ###
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
100 ### Functions and compilation/link commands
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
101 ###
258
daaad6ad8212 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 246
diff changeset
102 ifneq ($(V),1)
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
103 DO_CMD=/bin/echo -E " $(1) $(2)" && $(3)
258
daaad6ad8212 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 246
diff changeset
104 else
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
105 DO_CMD=/bin/echo -E $(3) && $(3)
258
daaad6ad8212 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 246
diff changeset
106 endif
263
f0e180b13e05 More build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 262
diff changeset
107 DO_MKDIR=if test ! -z "$(1)" -a ! -d "$(1)"; then /bin/echo -E " MKDIR $(1)"; mkdir -p "$(1)"; fi
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
108
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
109
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
110 COMPILE_C_OBJ = \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
111 @$(call DO_MKDIR,$(OBJPATH)) ; \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
112 $(call DO_CMD,CC,$<,$(CC) $(CFLAGS) $(DM_CFLAGS) -c -o $@ $< $(1))
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
113
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
114 LINK_C_BIN = \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
115 @$(call DO_MKDIR,$(BINPATH)) ; \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
116 $(call DO_CMD,LINK,$@,$(CC) -o $@ $(filter %.o %.a,$+) $(LDFLAGS) $(1))
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
117
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
118 COMPILE_CXX_OBJ = \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
119 @$(call DO_MKDIR,$(OBJPATH)) ; \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
120 $(call DO_CMD,CXX,$<,$(CXX) $(CXXFLAGS) $(DM_CFLAGS) -c -o $@ $< $(1))
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
121
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
122 LINK_CXX_BIN = \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
123 @$(call DO_MKDIR,$(BINPATH)) ; \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
124 $(call DO_CMD,LINK,$@,$(CXX) -o $@ $(filter %.o %.a,$+) $(LDFLAGS) $(1))
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
125
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
126 LINK_STATIC_LIB = \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
127 @$(call DO_MKDIR,$(OBJPATH)) ; \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
128 $(call DO_CMD,AR,$@ $(filter %.o,$+),$(AR) cru $@ $(filter %.o,$+)) ; \
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
129 $(call DO_CMD,RANLIB,$@,$(RANLIB) $@)
258
daaad6ad8212 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 246
diff changeset
130
daaad6ad8212 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 246
diff changeset
131
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
132 ###
262
847917a62ea2 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
133 ### Generic target rules
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
134 ###
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS)
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
138 moc_predefs.h:
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
139 @echo "" > $(OBJPATH)dummy.cpp
263
f0e180b13e05 More build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 262
diff changeset
140 @$(call DO_CMD,CXX,$@,$(CXX) $(CXXFLAGS) -dM -E -o $@ $(OBJPATH)dummy.cpp)
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
141
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
142 moc_%.cpp: %.h $(QT_MOC_RULES)
299
3dc88d3814b3 Rename some Makefile variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 292
diff changeset
143 @$(call DO_CMD,$(QT_VERSION_PREFIX):MOC,$@ $<,$(QT_MOC) $(QT_FLAGS) $(QT_MOC_FLAGS) $(QT_INCLUDES) $< -o $@)
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 ui_%.h: %.ui
292
47ecb4b14e3e Show Qt version we are building for in QT tool names.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
146 @$(call DO_CMD,$(QT_VERSION_PREFIX):UIC,$@ $<,$(QT_UIC) $(QT_UIC_FLAGS) $< -o $@)
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
149 $(OBJPATH)%.o: src/%.cpp src/%.h
299
3dc88d3814b3 Rename some Makefile variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 292
diff changeset
150 $(call COMPILE_CXX_OBJ, $(QT_FLAGS) $(QT_INCLUDES))
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
152 $(OBJPATH)%.o: src/%.cpp
299
3dc88d3814b3 Rename some Makefile variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 292
diff changeset
153 $(call COMPILE_CXX_OBJ, $(QT_FLAGS) $(QT_INCLUDES))
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
156 ###
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
157 ### Windows specific rules
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
158 ###
56
ac3daf42f781 Rename some files.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
159 %.rc: %.rc.in icon.ico VERSION
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
160 @sed -e "s/@APP_VERSION@/$(APP_VERSION)/g;s/@APP_VERSION_COM@/$(APP_VERSION_COM)/g;s#@APP_EXE@#$(notdir $(APP_BIN))#g" < $< > $@
49
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
161
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
162 $(OBJPATH)%.o: src/%.rc
263
f0e180b13e05 More build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 262
diff changeset
163 @$(call DO_CMD,WINDRES,$<,$(WINDRES) $< -O coff -o $@)
49
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
164
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
165
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
166 ###
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
167 ### Application rules
b86eb06070ba More work on buildsystem.
Matti Hamalainen <ccr@tnsp.org>
parents: 48
diff changeset
168 ###
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
169 ifneq ($(LOGO_SRC_SVG),)
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
170 $(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_SVG)
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
171 inkscape --export-area-page --export-type=png -w $(patsubst $(APP_IMG)icon-%.png,%,$@) -h $(patsubst $(APP_IMG)icon-%.png,%,$@) --export-filename="$@" "$<"
192
dfe5e8d7c58a Use the finalized Cafe Kampus logo.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
172
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
173 $(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_SVG)
279
770d1ea07a49 Add LOGO_SIZE Makefile variable.
Matti Hamalainen <ccr@tnsp.org>
parents: 275
diff changeset
174 inkscape --export-area-page --export-type=png -w $(LOGO_SIZE) -h $(LOGO_SIZE) --export-filename="$@" "$<"
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
175 else
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
176 $(APP_IMG)icon-%.png: $(APP_IMG)$(LOGO_SRC_PNG)
192
dfe5e8d7c58a Use the finalized Cafe Kampus logo.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
177 convert "$<" -scale "$(patsubst $(APP_IMG)icon-%.png,%,$@)x$(patsubst $(APP_IMG)icon-%.png,%,$@)" "$@"
dfe5e8d7c58a Use the finalized Cafe Kampus logo.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
178
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
179 $(APP_IMG)$(LOGO_PNG): $(APP_IMG)$(LOGO_SRC_PNG)
279
770d1ea07a49 Add LOGO_SIZE Makefile variable.
Matti Hamalainen <ccr@tnsp.org>
parents: 275
diff changeset
180 convert "$<" -scale "$(LOGO_SIZE)x$(LOGO_SIZE)" "$@"
275
d1f34cbc306e Improve logo/icons intermediate building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
181 endif
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182
80
c8fd927cd2c4 Restructure the project by placing source code, images into appropriate
Matti Hamalainen <ccr@tnsp.org>
parents: 76
diff changeset
183 icon.ico: $(addprefix $(APP_IMG),$(ICON_PNGS))
263
f0e180b13e05 More build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 262
diff changeset
184 @$(call DO_CMD,CONVERT,$+ -> $@,convert $+ $@)
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
186 src/%.cpp: src/%.qrc $(APP_RESOURCES)
292
47ecb4b14e3e Show Qt version we are building for in QT tool names.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
187 @$(call DO_CMD,$(QT_VERSION_PREFIX):RCC,$@ $<,$(QT_RCC) -name "Syntilista" $< -o $@)
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
233
6a12c82d082e Cleanup build.
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
189 $(OBJPATH)main.o: src/main.cpp $(APP_HDRS) VERSION
299
3dc88d3814b3 Rename some Makefile variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 292
diff changeset
190 $(call COMPILE_CXX_OBJ, $(QT_FLAGS) $(QT_INCLUDES))
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191
52
1ac8fdd932b3 More work on build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
192 $(APP_BIN): $(addprefix $(OBJPATH),$(APP_OBJS)) $(APP_DEP_LIBS) | $(APP_DEPS)
268
7276fe5efff6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 267
diff changeset
193 $(call LINK_CXX_BIN, $(APP_LIBS))
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
196 ###
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
197 ### Special targets
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
198 ###
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199 clean:
81
810ca71af506 Improve 'clean' target handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 80
diff changeset
200 -$(RM) $(TARGETS) $(NOINST_TARGETS) $(CLEAN_TARGETS) $(OBJPATH)*.o
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202 distclean: clean
52
1ac8fdd932b3 More work on build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
203 -$(RM) $(DISTCLEAN_TARGETS) *~ core *.core
48
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204
200ec310660a Begin revamp of the buildsystem, don't use qmake anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205 .PHONY: clean distclean all