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