-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
502 lines (415 loc) · 17.7 KB
/
Makefile.in
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# Mike's Makefile
# vim: set tabstop=4 expandtab autoindent smartindent:
# author: Sylvain Rabot <[email protected]>
# date: 03/07/2010
# copyright: All rights reserved
# __ _________ ______
# / |/ / _/ //_/ __/
# / /|_/ // // ,< / _/
# /_/ /_/___/_/|_/___/
#
# -- variables -----------------------------------------------------------------
prefix = @prefix@
APGDIFF = @APGDIFF@
AWK = @AWK@
BASENAME = @BASENAME@
BASH = @BASH@
CAT = @CAT@
CREATEDB = @CREATEDB@
CUT = @CUT@
DATE = @DATE@
DIRNAME = @DIRNAME@
DROPDB = @DROPDB@
ECHO = @ECHO@
GCC = @GCC@
GETOPT = @GETOPT@
GIT = @GIT@
GITSTATS = @GITSTATS@
GOURCE = @GOURCE@
GREP = @GREP@
INSTALL = @INSTALL@
MAKE = @MAKE@
NASM = @NASM@
PG_CONFIG = @PG_CONFIG@
PG_DUMP = @PG_DUMP@
PSQL = @PSQL@
REALPATH = @REALPATH@
RM = @RM@
SED = @SED@
SHELL = @SHELL@
SLEEP = @SLEEP@
TEE = @TEE@
TEST = @TEST@
WHICH = @WHICH@
CFLAGS ?= -Wall -O2
NASMFLAGS ?= -f elf -O2
SLEEP_TIME = @SLEEP_TIME@
SLEEP_TIME ?= 0.1
PSQL_EXTRA = --no-psqlrc -v ON_ERROR_STOP=on
RM_EXTRA = -rf
CONFIGURE_INVOCATION = @CONFIGURE_INVOCATION@
DATABASE_HOST = @DATABASE_HOST@
DATABASE_NAME = @DATABASE_NAME@
DATABASE_PORT = @DATABASE_PORT@
DATABASE_USER = @DATABASE_USER@
ENABLE_CREATE_DATABASE = @ENABLE_CREATE_DATABASE@
ENABLE_CREATE_SCHEMA = @ENABLE_CREATE_SCHEMA@
PG_CONTRIB_LTREE = @PG_CONTRIB_LTREE@
PG_CONTRIB_PGCRYPTO = @PG_CONTRIB_PGCRYPTO@
PG_CONTRIB_HSTORE = @PG_CONTRIB_HSTORE@
PG_SHAREDIR = @PG_SHAREDIR@
PG_INCLUDEDIR_SERVER = @PG_INCLUDEDIR_SERVER@
PG_PKGLIBDIR_SERVER = @PG_PKGLIBDIR_SERVER@
PG_VERSION = @PG_VERSION@
PG_VERSION_9_1 = @PG_VERSION_9_1@
PG_VERSION_GE_9_1 = @PG_VERSION_GE_9_1@
PG_VERSION_9_2 = @PG_VERSION_9_2@
PG_VERSION_GE_9_2 = @PG_VERSION_GE_9_2@
PG_VERSION_9_3 = @PG_VERSION_9_3@
PG_VERSION_GE_9_3 = @PG_VERSION_GE_9_3@
X86_64 = @X86_64@
DEV_MODE = @DEV_MODE@
DEFAULT_USERS = @DEFAULT_USERS@
TREE_MAX_DEPTH = @TREE_MAX_DEPTH@
INODE_RAND_COLUMN = @INODE_RAND_COLUMN@
NO_ATIME = @NO_ATIME@
NO_VOLUME_LOCK = @NO_VOLUME_LOCK@
NATSORT_PADDING = @NATSORT_PADDING@
LVM_SUPPORT = @LVM_SUPPORT@
LVM_DEFAULT_LV_NUMBER = @LVM_DEFAULT_LV_NUMBER@
# -- custom files --------------------------------------------------------------
MIKE_VERSION_FILE = MIKE_VERSION_FILE
MIKE_TAG_DIFF_FILE = MIKE_TAG_DIFF_FILE
MIKE_HEAD_DIFF_FILE = MIKE_HEAD_DIFF_FILE
INSTALL_LOG = install.log
# -- git -----------------------------------------------------------------------
ifneq ($(GIT),)
GIT_DIR=$(realpath $(shell $(GIT) rev-parse --git-dir 2>/dev/null))
ifneq ($(GIT_DIR),)
IS_BARE_REPOSITORY=`$(GIT) rev-parse --is-bare-repository 2>/dev/null`
IS_INSIDE_WORK_TREE=`$(GIT) rev-parse --is-inside-work-tree 2>/dev/null`
endif
endif
# -- version -------------------------------------------------------------------
$(MIKE_VERSION_FILE):
ifneq ($(GIT_DIR),)
@$(RM) $(RM_EXTRA) $(MIKE_VERSION_FILE)
@$(SHELL) ./MIKE_VERSION_GEN $(MIKE_VERSION_FILE) $(MIKE_HEAD_DIFF_FILE) $(MIKE_TAG_DIFF_FILE)
endif
-include $(MIKE_VERSION_FILE)
# -- database schema -----------------------------------------------------------
# include database files list
include types/types.mak
include functions/functions.mak
include functions/c/c.mak
include functions/asm/asm.mak
include views/views.mak
include triggers/triggers.mak
include indexes/indexes.mak
include data/data.mak
TARGET_FILE = mike.o
DATABASE_FILES = mike.sql
DATABASE_FILES += $(patsubst %, types/%, $(DATABASE_TYPES))
DATABASE_FILES += $(patsubst %, functions/%, $(DATABASE_FUNCTIONS))
DATABASE_FILES += $(patsubst %, views/%, $(DATABASE_VIEWS))
DATABASE_FILES += $(patsubst %, triggers/%, $(DATABASE_TRIGGERS))
DATABASE_FILES += $(patsubst %, indexes/%, $(DATABASE_INDEXES))
DATABASE_FILES += $(patsubst %, data/%, $(DATABASE_DATA))
DATABASE_C_PATTERN = functions/c/%.c
DATABASE_C_O_PATTERN = functions/c/%.o
DATABASE_ASM_PATTERN = functions/asm/%.asm
DATABASE_ASM_O_PATTERN = functions/asm/%.o
DATABASE_C_FILES = $(patsubst %.c, $(DATABASE_C_PATTERN), $(DATABASE_C_FUNCTIONS))
DATABASE_C_O = $(patsubst %.c, $(DATABASE_C_O_PATTERN), $(DATABASE_C_FUNCTIONS))
DATABASE_ASM_FILES = $(patsubst %.asm, $(DATABASE_ASM_PATTERN), $(DATABASE_ASM_FUNCTIONS))
DATABASE_ASM_O = $(patsubst %.asm, $(DATABASE_ASM_O_PATTERN), $(DATABASE_ASM_FUNCTIONS))
DATABASE_SO = functions/mike.so
ifeq ($(DEV_MODE),yes)
DATABASE_INSTALLED_SO = functions/mike-$(MIKE_VERSION).so
else
DATABASE_INSTALLED_SO = $(PG_PKGLIBDIR_SERVER)/mike-$(MIKE_VERSION).so
endif
# -- gcc defines ---------------------------------------------------------------
DEFINES = -D MIKE_VERSION="$(MIKE_VERSION)"
DEFINES += -D NATSORT_PADDING=$(NATSORT_PADDING)
DEFINES += -D PG_VERSION=$(PG_VERSION)
ifneq ($(TREE_MAX_DEPTH),no)
ifneq ($(TREE_MAX_DEPTH),yes)
DEFINES += -D TREE_MAX_DEPTH=$(TREE_MAX_DEPTH)
else
DEFINES += -D TREE_MAX_DEPTH=24
endif
endif
ifeq ($(INODE_RAND_COLUMN),yes)
DEFINES += -D INODE_RAND_COLUMN
endif
ifeq ($(NO_ATIME),yes)
DEFINES += -D NO_ATIME
endif
ifeq ($(NO_VOLUME_LOCK),yes)
DEFINES += -D NO_VOLUME_LOCK
endif
ifeq ($(LVM_SUPPORT),yes)
DEFINES += -D LVM_SUPPORT
DEFINES += -D LVM_DEFAULT_LV_NUMBER=$(LVM_DEFAULT_LV_NUMBER)
endif
ifeq ($(DEV_MODE),yes)
DEFINES += -D DEV_MODE
DEFINES += -D DATABASE_INSTALLED_SO="'$(shell pwd)/functions/mike-$(MIKE_VERSION).so'"
else
DEFINES += -D DATABASE_INSTALLED_SO="'\$$libdir/mike-$(MIKE_VERSION).so'"
endif
ifeq ($(X86_64),yes)
DEFINES += -D X86_64
endif
ifeq ($(PG_VERSION_9_1),yes)
DEFINES += -D PG_VERSION_9_1
endif
ifeq ($(PG_VERSION_GE_9_1),yes)
DEFINES += -D PG_VERSION_GE_9_1
endif
ifeq ($(PG_VERSION_9_2),yes)
DEFINES += -D PG_VERSION_9_2
endif
ifeq ($(PG_VERSION_GE_9_2),yes)
DEFINES += -D PG_VERSION_GE_9_2
endif
ifeq ($(PG_VERSION_9_3),yes)
DEFINES += -D PG_VERSION_9_3
endif
ifeq ($(PG_VERSION_GE_9_3),yes)
DEFINES += -D PG_VERSION_GE_9_3
endif
# -- tests ---------------------------------------------------------------------
ifneq ($(DATABASE_HOST),)
PSQL_HOST = -h $(DATABASE_HOST)
else
DATABASE_HOST = localhost
endif
ifneq ($(DATABASE_PORT),)
PSQL_PORT = -p $(DATABASE_PORT)
endif
# -- psql ----------------------------------------------------------------------
PSQL_FULL_CMD = PGOPTIONS='--client-min-messages=warning' $(PSQL) -U $(DATABASE_USER) -d $(DATABASE_NAME) $(PSQL_EXTRA) $(PSQL_HOST) $(PSQL_PORT)
# -- compiler flags ------------------------------------------------------------
# this target is used to recompile files when flags changed since last
# execution. To enable a set of files to be rebuild on flags change
# MIKE_COMPILER_FLAGS must be referenced as prerequisite
MIKE_COMPILER_FLAGS : .FORCE
@($(ECHO) CFLAGS=$(CFLAGS); \
$(ECHO) NASMFLAGS=$(NASMFLAGS); \
$(ECHO) DEFINES=$(DEFINES)) \
| cmp -s - $@ \
|| ($(ECHO) CFLAGS=$(CFLAGS); \
$(ECHO) NASMFLAGS=$(NASMFLAGS); \
$(ECHO) DEFINES=$(DEFINES)) > $@
# -- mike.o --------------------------------------------------------------------
clean-target:
@$(ECHO) ' ' REMOVING $(TARGET_FILE)
@$(RM) $(RM_EXTRA) $(TARGET_FILE)
@$(SLEEP) $(SLEEP_TIME)
info:
@$(ECHO) ' ' LINK MIKE_VERSION "$(MIKE_VERSION)";
@$(ECHO) "INSERT INTO mike.info (key, value) VALUES ('MIKE_VERSION', '$(MIKE_VERSION)');" >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(ECHO) ' ' LINK MIKE_COMMIT "$(MIKE_COMMIT)";
@$(ECHO) "INSERT INTO mike.info (key, value) VALUES ('MIKE_COMMIT', '$(MIKE_COMMIT)');" >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(ECHO) ' ' LINK MIKE_BRANCH "$(MIKE_BRANCH)";
@$(ECHO) "INSERT INTO mike.info (key, value) VALUES ('MIKE_BRANCH', '$(MIKE_BRANCH)');" >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(ECHO) ' ' LINK MIKE_WHO_INSTALLED "$(MIKE_WHO_INSTALLED)";
@$(ECHO) "INSERT INTO mike.info (key, value) VALUES ('MIKE_WHO_INSTALLED', '$(MIKE_WHO_INSTALLED)');" >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(ECHO) ' ' LINK INSTALL_DATE `$(DATE)`;
@$(ECHO) "INSERT INTO mike.info (key, value) VALUES ('MIKE_INSTALL_DATE', now()::text);" >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(ECHO) ' ' LINK MIKE_CONFIGURE_INVOCATION "$(CONFIGURE_INVOCATION)";
@($(ECHO) -n "INSERT INTO mike.info (key, value) VALUES ('MIKE_CONFIGURE_INVOCATION', E'"; \
($(ECHO) -n "$(CONFIGURE_INVOCATION)" | $(SED) "s/\(['\\]\)/\1\1/g"); \
$(ECHO) "');";) >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(ECHO) ' ' LINK MIKE_DEFINES "$(DEFINES)";
@$(ECHO) "INSERT INTO mike.info (key, value) VALUES ('MIKE_DEFINES', E'$(DEFINES)');" >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(ECHO) ' ' LINK MIKE_CFLAGS "$(CFLAGS)";
@$(ECHO) "INSERT INTO mike.info (key, value) VALUES ('MIKE_CFLAGS', E'$(CFLAGS)');" >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@# MIKE_TAG_DIFF_FILE
@$(ECHO) -n; \
if test -f $(MIKE_TAG_DIFF_FILE); then \
$(ECHO) ' ' LINK MIKE_TAG_DIFF_FILE; \
($(ECHO) -n "INSERT INTO mike.info (key, value) VALUES ('MIKE_TAG_DIFF', E'"; \
cat $(MIKE_TAG_DIFF_FILE) | $(SED) "s/\(['\\]\)/\1\1/g"; \
$(ECHO) -n "');";) >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME); \
fi
@# MIKE_HEAD_DIFF_FILE
@$(ECHO) -n; \
if test -f $(MIKE_HEAD_DIFF_FILE); then \
$(ECHO) ' ' LINK MIKE_HEAD_DIFF_FILE; \
($(ECHO) -n "INSERT INTO mike.info (key, value) VALUES ('MIKE_HEAD_DIFF', E'"; \
cat $(MIKE_HEAD_DIFF_FILE) | $(SED) "s/\(['\\]\)/\1\1/g"; \
$(ECHO) -n "');";) >> $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME); \
fi
$(DATABASE_FILES): $(DATABASE_INSTALLED_SO)
@$(ECHO) ' ' LINK $@
@$(GCC) -x c -E -CC -P "$@" $(DEFINES) 2> /dev/null >> $(TARGET_FILE)
@$(SLEEP) $(SLEEP_TIME)
# -- c files -------------------------------------------------------------------
$(DATABASE_INSTALLED_SO) : $(DATABASE_SO)
@$(ECHO) ' ' INSTALL $<
@$(INSTALL) -T $< $@
@$(SLEEP) $(SLEEP_TIME)
$(DATABASE_SO) : $(DATABASE_ASM_O) $(DATABASE_C_O)
@$(ECHO) ' ' LINK TO $@
@$(GCC) $(CFLAGS) -shared -o $@ $^ $(DEFINES)
@$(SLEEP) $(SLEEP_TIME)
$(DATABASE_C_O_PATTERN) : $(DATABASE_C_PATTERN) MIKE_COMPILER_FLAGS
@$(ECHO) ' ' GCC $<
@$(GCC) $(CFLAGS) -fpic -c -o $@ $< -I $(PG_INCLUDEDIR_SERVER) $(DEFINES)
@$(SLEEP) $(SLEEP_TIME)
$(DATABASE_ASM_O_PATTERN) : $(DATABASE_ASM_PATTERN) MIKE_COMPILER_FLAGS
@$(ECHO) ' ' NASM $<
@$(NASM) $(NASMFLAGS) -o $@ $<
@$(SLEEP) $(SLEEP_TIME)
# -- install -------------------------------------------------------------------
install::
@$(MAKE) --no-print-directory install-sub $(MAKEFLAGS)
install-sub: clean-target $(DATABASE_FILES) info
# create database
ifeq ($(ENABLE_CREATE_DATABASE),yes)
@$(ECHO) ' ' CREATING DATABASE $(DATABASE_NAME) ON $(DATABASE_USER)@$(DATABASE_HOST);
@PGOPTIONS='--client-min-messages=warning' $(CREATEDB) $(PSQL_HOST) $(PSQL_PORT) -U $(DATABASE_USER) $(DATABASE_NAME) --encoding UTF8
@$(ECHO) ' ' ALTERING DATABASE;
@$(ECHO) "ALTER DATABASE $(DATABASE_NAME) SET client_min_messages TO 'log';" | $(PSQL_FULL_CMD) --quiet
@$(ECHO) ' ' CREATING LANGUAGE plpgsql;
@$(ECHO) "CREATE OR REPLACE LANGUAGE plpgsql;" | $(PSQL_FULL_CMD) --quiet
@$(ECHO) ' ' CREATING LANGUAGE plperl;
@$(ECHO) "CREATE OR REPLACE LANGUAGE plperl;" | $(PSQL_FULL_CMD) --quiet
# contribs
ifeq ($(PG_VERSION_GE_9_1),yes)
@$(ECHO) ' ' CREATING EXTENSION ltree;
@$(PSQL_FULL_CMD) --single-transaction -c "CREATE EXTENSION ltree;" --quiet
@$(ECHO) ' ' CREATING EXTENSION pgcrypto;
@$(PSQL_FULL_CMD) --single-transaction -c "CREATE EXTENSION pgcrypto;" --quiet
@$(ECHO) ' ' CREATING EXTENSION hstore;
@$(PSQL_FULL_CMD) --single-transaction -c "CREATE EXTENSION hstore;" --quiet
else
@$(ECHO) ' ' IMPORTING CONTRIB ltree;
@$(PSQL_FULL_CMD) --single-transaction --file $(PG_CONTRIB_LTREE) --quiet
@$(ECHO) ' ' IMPORTING CONTRIB pgcrypto;
@$(PSQL_FULL_CMD) --single-transaction --file $(PG_CONTRIB_PGCRYPTO) --quiet
@$(ECHO) ' ' IMPORTING CONTRIB hstore;
@$(PSQL_FULL_CMD) --single-transaction --file $(PG_CONTRIB_HSTORE) --quiet
endif # PG_VERSION_GE_9_1
endif # ENABLE_CREATE_DATABASE
# create schema
ifeq ($(ENABLE_CREATE_SCHEMA),yes)
@$(ECHO) ' ' DROPPING SCHEMA mike IF EXISTS;
@$(ECHO) "DROP SCHEMA IF EXISTS mike CASCADE;" | $(PSQL_FULL_CMD) --quiet
@$(ECHO) ' ' CREATING SCHEMA mike;
@$(ECHO) "CREATE SCHEMA mike;" | $(PSQL_FULL_CMD) --quiet
@$(ECHO) ' ' ALTERING search_path;
@$(ECHO) "ALTER DATABASE $(DATABASE_NAME) SET search_path TO mike,public;" | $(PSQL_FULL_CMD) --quiet
endif
@$(ECHO) ' ' IMPORTING $(TARGET_FILE); $(SLEEP) $(SLEEP_TIME)
@$(PSQL_FULL_CMD) --single-transaction --file $(TARGET_FILE) --log-file $(INSTALL_LOG) > /dev/null
# -- drop ----------------------------------------------------------------------
drop-database:
@$(ECHO) ' ' DROPPING $(DATABASE_NAME) DATABASE IF EXISTS;
@$(ECHO) "DROP DATABASE IF EXISTS $(DATABASE_NAME);" | $(PSQL) -U $(DATABASE_USER) $(PSQL_EXTRA) $(PSQL_HOST) $(PSQL_PORT) -d postgres --quiet
drop-schema:
@$(ECHO) ' ' DROPPING mike SCHEMA IF EXISTS;
@$(ECHO) "DROP SCHEMA IF EXITS mike;" | $(PSQL_FULL_CMD)
drop-functions:
@$(ECHO) ' ' DROPPING mike FUNCTIONS;
@$(ECHO) "SELECT mike.__perform('DROP FUNCTION ' || p.proname || '(' || " \
"pg_catalog.pg_get_function_identity_arguments(p.oid) || ')') " \
"FROM pg_catalog.pg_proc p " \
"LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace " \
"WHERE n.nspname = 'mike' AND p.proname != '__perform'" \
| $(PSQL_FULL_CMD) > /dev/null
@$(ECHO) "DROP FUNCTION mike.__perform(text);" | $(PSQL_FULL_CMD) > /dev/null
# -- clean ---------------------------------------------------------------------
clean: clean-doc
@$(ECHO) Removing config.log; $(RM) $(RM_EXTRA) config.log;
@$(ECHO) Removing config.status; $(RM) $(RM_EXTRA) config.status;
@$(ECHO) Removing autom4te.cache; $(RM) $(RM_EXTRA) autom4te.cache;
@$(ECHO) Removing install.log; $(RM) $(RM_EXTRA) install.log;
@$(ECHO) Removing c objects; $(RM) $(RM_EXTRA) functions/c/*.o;
@$(ECHO) Removing asm objects; $(RM) $(RM_EXTRA) functions/asm/*.o;
@$(ECHO) Removing shared object; $(RM) $(RM_EXTRA) $(DATABASE_SO);
clean-git: clean-doc
@$(GIT) clean -fdx
# -- development ---------------------------------------------------------------
dev-object: clean-target $(DATABASE_FILES) info
dev-functions: $(DATABASE_FUNCTIONS)
$(DATABASE_FUNCTIONS): $(DATABASE_INSTALLED_SO)
@$(ECHO) ' ' GCC $@;
@$(GCC) -x c -E -CC -P "functions/$@" $(DEFINES) 2>/dev/null | $(PSQL_FULL_CMD) > /dev/null
dev-triggers: $(DATABASE_TRIGGERS)
$(DATABASE_TRIGGERS):
@$(ECHO) ' ' GCC $@;
@$(GCC) -x c -E -CC -P "triggers/$@" $(DEFINES) 2>/dev/null | $(PSQL_FULL_CMD) > /dev/null
dev-volumes:
@$(ECHO) ' ' IMPORTING contrib/sql/mike-volumes.sql;
@$(PSQL_FULL_CMD) -f contrib/sql/mike-volumes.sql > /dev/null
# -- git -----------------------------------------------------------------------
graph: .FORCE
ifeq ($(GIT),)
@$(ECHO) >&2 "git not installed ...";
@exit 1
else ifeq ($(GIT_DIR),)
@$(ECHO) >&2 "not in a git repository ...";
@exit 1
endif
@$(GIT) log --graph --all --format="format:%C(yellow)%h %Creset%an: %s"
stats: .FORCE
ifeq ($(GIT),)
@$(ECHO) >&2 "git not installed ...";
@exit 1
else ifeq ($(GIT_DIR),)
@$(ECHO) >&2 "not in a git repository ...";
@exit 1
endif
@$(ECHO) Number of commits by author :
@$(GIT) shortlog --summary --no-merges --numbered --email
gitstats: .FORCE
ifeq ($(GIT),)
@$(ECHO) >&2 "git not installed ...";
@exit 1
else ifeq ($(GITSTATS),)
@$(ECHO) >&2 "gitstats not installed ...";
@exit 1
else ifeq ($(GIT_DIR),)
@$(ECHO) >&2 "not in a git repository ...";
@exit 1
endif
@$(GITSTATS) `$(REALPATH) .` stats
gource: .FORCE
ifeq ($(GIT),)
@$(ECHO) >&2 "git not installed ...";
@exit 1
else ifeq ($(GOURCE),)
@$(ECHO) >&2 "gource not installed ...";
@exit 1
else ifeq ($(GIT_DIR),)
@$(ECHO) >&2 "not in a git repository ...";
@exit 1
endif
@$(GOURCE) --title "Mike's `$(GIT) branch --no-color | $(GREP) "^*" --color=never | $(CUT) -b 3-` branch" \
--key --highlight-users --highlight-dirs --file-idle-time 0 --loop &
# -- documentation -------------------------------------------------------------
doc:
@$(MAKE) --no-print-directory -C documentation all
man:
@$(MAKE) --no-print-directory -C documentation man
html:
@$(MAKE) --no-print-directory -C documentation html
install-doc:
@$(MAKE) --no-print-directory -C documentation install
install-html:
@$(MAKE) --no-print-directory -C documentation install-html
install-man:
@$(MAKE) --no-print-directory -C documentation install-man
clean-doc:
@$(MAKE) --no-print-directory -C documentation clean
@$(RM) $(RM_EXTRA) documentation/Makefile
# -- test ----------------------------------------------------------------------
test:
@$(MAKE) --no-print-directory -C test all
# -- special targets -----------------------------------------------------------
.NOTPARALLEL: $(DATABASE_FILES) drop-database
.PHONY: $(MIKE_VERSION_FILE) $(DATABASE_FILES) test .FORCE