schema-related information (like schema version, DB syntax, etc.) moved from "config...
[public/netxms.git] / sql / Makefile.w32
1 #
2 # Makefile for SQL scripts (Win32)
3 #
4
5 CPP = cpp
6
7 sql_SCRIPTS = 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 maps.in policy.in objtools.in scripts.in maps.in
20 HEADERS = ../include/netxmsdb.h ../include/nxevent.h ../include/nximage.h ../src/server/include/nms_locks.h
21 COMMAND = $(CPP) -P -Wundef -D_NETXMS_DB_SCHEMA_ -I../include -I../src/server/include
22 SQUEEZE = perl -e "while (<>) { if (! /^[\s\t\n]*$$/) { print; } }"
23
24 all: $(sql_SCRIPTS)
25
26 dbinit_mysql.sql: $(SOURCE) $(HEADERS)
27 $(COMMAND) -DDB_MYSQL $(ROOT_FILE) | $(SQUEEZE) > $@
28
29 dbinit_pgsql.sql: $(SOURCE) $(HEADERS)
30 $(COMMAND) -DDB_POSTGRESQL $(ROOT_FILE) | $(SQUEEZE) > $@
31
32 dbinit_mssql.sql: $(SOURCE) $(HEADERS)
33 $(COMMAND) -DDB_MSSQL $(ROOT_FILE) | $(SQUEEZE) > $@
34
35 dbinit_oracle.sql: $(SOURCE) $(HEADERS)
36 $(COMMAND) -DDB_ORACLE $(ROOT_FILE) | $(SQUEEZE) > $@
37
38 dbinit_sqlite.sql: $(SOURCE) $(HEADERS)
39 $(COMMAND) -DDB_SQLITE $(ROOT_FILE) | $(SQUEEZE) > $@
40
41 dbschema_mysql.sql: $(SOURCE) $(HEADERS)
42 $(COMMAND) -DDB_MYSQL -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
43
44 dbschema_pgsql.sql: $(SOURCE) $(HEADERS)
45 $(COMMAND) -DDB_POSTGRESQL -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
46
47 dbschema_mssql.sql: $(SOURCE) $(HEADERS)
48 $(COMMAND) -DDB_MSSQL -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
49
50 dbschema_oracle.sql: $(SOURCE) $(HEADERS)
51 $(COMMAND) -DDB_ORACLE -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
52
53 dbschema_sqlite.sql: $(SOURCE) $(HEADERS)
54 $(COMMAND) -DDB_SQLITE -DSCHEMA_ONLY $(ROOT_FILE) | $(SQUEEZE) > $@
55
56 clean:
57 cmd /c del dbinit_*.sql