Project

General

Profile

1 250 aaronmk
ifndef db
2
$(error db variable must be set)
3
endif
4
5 247 aaronmk
self_3d1bc249 := $(dir $(lastword $(MAKEFILE_LIST)))
6
7 250 aaronmk
mysql := mysql --user=root --password='$(shell cat \
8 247 aaronmk
$(self_3d1bc249)/bien_password)'
9
10 250 aaronmk
#####
11
12 247 aaronmk
all: _not_file install
13
14
.SUFFIXES:
15
16
_not_file:
17
.PHONY: _not_file
18 250 aaronmk
19
#####
20
21
install: _not_file
22
	$(mysql) <$(db).sql
23
	echo "GRANT ALL ON $(db).* TO 'bien'@'localhost';"|$(mysql)
24
25
uninstall: _not_file
26
	echo "DROP DATABASE IF EXISTS $(db);"|$(mysql)
27
28
reinstall: _not_file uninstall install