Project

General

Profile

1
ifndef db
2
$(error db variable must be set)
3
endif
4

    
5
self_3d1bc249 := $(dir $(lastword $(MAKEFILE_LIST)))
6

    
7
mysql := mysql --user=root --password='$(shell cat \
8
$(self_3d1bc249)/bien_password)'
9

    
10
#####
11

    
12
all: _not_file install
13

    
14
.SUFFIXES:
15

    
16
_not_file:
17
.PHONY: _not_file
18

    
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
(5-5/16)