schema-related information (like schema version, DB syntax, etc.) moved from "config...
[public/netxms.git] / sql / Makefile.am
CommitLineData
704c99a0
AK
1#
2# Makefile for SQL scripts
3#
4
5sqldir=$(pkgdatadir)/sql
6
4f23eecc
VK
7sql_DATA = dbinit_mysql.sql \
8 dbinit_pgsql.sql \
9 dbinit_mssql.sql \
10 dbinit_oracle.sql \
11 dbinit_sqlite.sql \
12 dbschema_mysql.sql \
13 dbschema_pgsql.sql \
14 dbschema_mssql.sql \
15 dbschema_oracle.sql \
16 dbschema_sqlite.sql
704c99a0
AK
17
18ROOT_FILE = dbinit.in
28f5b9a4 19SOURCE = $(ROOT_FILE) database.in schema.in metadata.in setup.in events.in images.in policy.in objtools.in scripts.in maps.in
17a48052
VK
20HEADER_FILES = ../include/netxmsdb.h ../include/nxevent.h ../include/nximage.h ../src/server/include/nms_locks.h
21COMMAND = $(CPP) -x c -P -Wundef -D_NETXMS_DB_SCHEMA_ -I@top_srcdir@/include -I@top_srcdir@/src/server/include
c13cb4a5 22SQUEEZE = perl -n -e "if (! /^[\s\t\n]*$$/) { print; }"
704c99a0 23
82fa7c5d 24all: $(sql_DATA)
704c99a0 25
96ecd557 26dbinit_mysql.sql: $(SOURCE) $(HEADER_FILES)
704c99a0
AK
27 $(COMMAND) -DDB_MYSQL $(ROOT_FILE) | $(SQUEEZE) > $@
28
96ecd557 29dbinit_pgsql.sql: $(SOURCE) $(HEADER_FILES)
704c99a0
AK
30 $(COMMAND) -DDB_POSTGRESQL $(ROOT_FILE) | $(SQUEEZE) > $@
31
96ecd557 32dbinit_mssql.sql: $(SOURCE) $(HEADER_FILES)
704c99a0
AK
33 $(COMMAND) -DDB_MSSQL $(ROOT_FILE) | $(SQUEEZE) > $@
34
fa3f5211
VK
35dbinit_oracle.sql: $(SOURCE) $(HEADER_FILES)
36 $(COMMAND) -DDB_ORACLE $(ROOT_FILE) | $(SQUEEZE) > $@
37
9486b324
VK
38dbinit_sqlite.sql: $(SOURCE) $(HEADER_FILES)
39 $(COMMAND) -DDB_SQLITE $(ROOT_FILE) | $(SQUEEZE) > $@
40
4f23eecc
VK
41dbschema_mysql.sql: $(SOURCE) $(HEADER_FILES)
42 $(COMMAND) -DDB_MYSQL -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
43
44dbschema_pgsql.sql: $(SOURCE) $(HEADER_FILES)
45 $(COMMAND) -DDB_POSTGRESQL -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
46
47dbschema_mssql.sql: $(SOURCE) $(HEADER_FILES)
48 $(COMMAND) -DDB_MSSQL -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
49
50dbschema_oracle.sql: $(SOURCE) $(HEADER_FILES)
51 $(COMMAND) -DDB_ORACLE -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
52
53dbschema_sqlite.sql: $(SOURCE) $(HEADER_FILES)
54 $(COMMAND) -DDB_SQLITE -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
55
704c99a0
AK
56clean:
57 rm -f dbinit_*.sql
e479a8a1 58
0c3c0c39 59EXTRA_DIST = \
82fa7c5d 60 $(sql_DATA) \
ce99c536 61 dbinit.in database.in events.in images.in \
28f5b9a4
VK
62 policy.in schema.in setup.in traps.in objtools.in scripts.in \
63 metadata.in maps.in