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