]> matita.cs.unibo.it Git - helm.git/blobdiff - metadata/dc/Makefile
reorganization continues ...
[helm.git] / metadata / dc / Makefile
diff --git a/metadata/dc/Makefile b/metadata/dc/Makefile
new file mode 100644 (file)
index 0000000..c9a7c73
--- /dev/null
@@ -0,0 +1,32 @@
+
+SQL_DB = mowgli
+SQL_DIR = sql
+SQL_HOST = localhost
+SQL_PASSWORD = bjIcRpru
+SQL_USER = helmadmin
+DC_DIR = /projects/helm/library/dc/
+
+SQL_ENGINE = \
+       mysql -h $(SQL_HOST) -u $(SQL_USER) --password=$(SQL_PASSWORD) $(SQL_DB)
+
+all:
+       @echo "try one of:"
+       @echo "  make connect"
+       @echo "  make create_tables"
+       @echo "  make fill_db"
+       @echo "  make drop_tables"
+
+connect:
+       $(SQL_ENGINE)
+
+create_tables:
+       $(SQL_ENGINE) < $(SQL_DIR)/create_dc_tables.sql
+
+fill_db:
+       find $(DC_DIR) -name "*.xml" -exec ./fill_db.pl {} \; | $(SQL_ENGINE)
+
+drop_tables:
+       $(SQL_ENGINE) < $(SQL_DIR)/drop_dc_tables.sql
+
+.PHONY: all connect create_tables fill_db drop_tables
+