-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·42 lines (34 loc) · 1.23 KB
/
Copy pathMakefile
File metadata and controls
executable file
·42 lines (34 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Set up your PostgreSql credentials here
PGUSER=changeme
PGPASSWORD=changeme
TEMPLATE=template1
# Setup these paths to match your system
CLASSPATH="/usr/share/java/postgresql-jdbc2.jar:."
JAVA_BIN="/opt/j2sdk1.4.2_08/bin/"
all:
echo Run "make load_db" to load the database, or "make test" to run build and run the client
test:
$(JAVA_BIN)/javac *.java
$(JAVA_BIN)/java -classpath $(CLASSPATH) FlashCardController
clean:
rm -f *.bak *\~
create_db: delete_db
echo Creating the database...
createdb -U $(PGUSER) -T $(TEMPLATE) aleman
create_tables: create_db
psql -U $(PGUSER) aleman < create_tables.sql
load_db: create_tables
echo Loading data...
psql -U $(PGUSER) aleman < load_cardholder.sql
psql -U $(PGUSER) aleman < load_declension.sql
psql -U $(PGUSER) aleman < load_nouns.sql
psql -U $(PGUSER) aleman < load_conjunctions.sql
psql -U $(PGUSER) aleman < load_determiner.sql
psql -U $(PGUSER) aleman < load_preposition.sql
psql -U $(PGUSER) aleman < load_pronouns.sql
psql -U $(PGUSER) aleman < load_verbs.sql
psql -U $(PGUSER) aleman < load_adverbs.sql
psql -U $(PGUSER) aleman < load_interjections.sql
psql -U $(PGUSER) aleman < load_adjectives.sql
delete_db:
dropdb -U $(PGUSER) aleman >& /dev/null || echo Database deleted