forked from AlmasB/CI553-CW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
173 lines (146 loc) · 6.65 KB
/
Makefile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# ####################################################################
# Version 20-October-2015
# THESE DEFINITIONS WILL HAVE TO BE CHANGED FOR YOUR COMPUTER
# ####################################################################
#
# --------------------------------------------------------------------
#IMPORTANT variables
# DERBY_HOME JUNIT
# should be set to the appropriate path for your system
# SEP
# should be set to the appropriate separator between file names
#
# The last definition is the one used
# (The currently set (last used) is for cygwin on windows)
#
# Note you will need to add the JUnit test file you create
# to the files that are compiled
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# The base of the Apache Derby database system
# --------------------------------------------------------------------
DERBY_HOME=$(WORKSPACE)/lib/db-derby-10.14.2.0-lib
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# Where the JUnit jar file is held
# Only needed if you are to compile a JUnit test class
# By default you do (orders.OrderTest.java)
# --------------------------------------------------------------------
JUNIT=/opt/java/current/lib/junit-4.8.2.jar
JUNIT="C:/Program Files (x86)/BlueJ/lib/junit-4.8.2.jar"
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# Separator used in java classpath (; Windows : Unix/Linux)
# --------------------------------------------------------------------
SEP=:
SEP=\;
# --------------------------------------------------------------------
# ####################################################################
# DO NOT CHANGE BEYOND HERE
# ####################################################################
# --------------------------------------------------------------------
# class path for compilation/ run
# --------------------------------------------------------------------
#CP_DERBY=$(DERBY_HOME)/derby.jar$(SEP)$(DERBY_HOME)/derbytools.jar$(SEP).
CP_DERBY=$(DERBY_HOME)/lib/derbyshared.jar$(SEP)$(DERBY_HOME)/lib/derby.jar$(SEP)$(DERBY_HOME)/lib/derbytools.jar$(SEP).
#
DEPRECATED=-Xlint:deprecation
DEPRECATED=
FLAGS= -source 1.8 -Xlint:unchecked
FLAGS= -source 1.8
FLAGS=
compile:
javac $(DEPRECATED) $(FLAGS) -cp $(JUNIT) \
catalogue/*.java \
middle/*.java \
dbAccess/*.java \
orders/Order.java \
orders/OrderTest.java \
orders/OrderX.java \
orders/OrderTestX.java \
clients/*.java \
clients/*/*.java \
remote/*.java \
debug/*.java
clean:
rm -f -r catshop.db
rm -f */*.class */*/*.class */*.bak *.bak
rm -f -r html
rm -f 00text 00text.rtf 000text 000text.rtf
rm -f -r doc
rm -f clients/__SHEL*
rm -f _list.sh derby.log
rm -f *.jar Mainifest.MF manifest2.MF
doc:
echo "Making documentation"
javadoc -sourcepath $(WIN_SDK1)\\src.zip \
-classpath $(JUNIT) \
-group catalogue Catalogue \
-header "<FONT color="lightblue">CatShop</FONT>" \
-author -windowtitle "CatShop" \
-use -splitindex -d html \
-package clients/*.java \
clients/backDoor/*.java \
clients/cashier/*.java \
clients/collection/*.java \
clients/customer/*.java \
clients/shopDisplay/*.java \
clients/warehousePick/*.java \
catalogue/*.java middle/*.java \
dbAccess/*.java orders/*.java remote/*.java \
debug/*.java
jar:
echo "Requires derby.jar in the current directory"
cp $(DERBY_HOME)/derby.jar derby.jar
echo Manifest-Version: 1.0 > Manifest.MF
echo Created-By: mas >> Manifest.MF
echo Class-Path: ./derby.jar >> Manifest.MF
echo Main-Class: clients.Main >> Manifest.MF
jar cfm catshop.jar Manifest.MF \
catalogue/*.class \
middle/*.class \
dbAccess/*.class \
orders/Order*.class \
clients/*.class \
clients/*/*.class \
remote/*.class \
debug/*.class \
DataBase.txt
echo Manifest-Version: 1.0 > Manifest2.MF
echo Created-By: mas >> Manifest2.MF
echo Class-Path: ./derby.jar >> Manifest2.MF
echo Main-Class: clients.Setup >> Manifest2.MF
jar cfm setup.jar Manifest2.MF \
catalogue/*.class \
middle/*.class \
dbAccess/*.class \
orders/Order*.class \
clients/*.class \
clients/*/*.class \
remote/*.class \
debug/*.class \
DataBase.txt
jarrun:
java -jar setup.jar
java -jar catshop.jar
test:
java -cp $(JUNIT)$(SEP)$(CP_DERBY) org.junit.runner.JUnitCore orders.OrderTest
testX:
java -cp $(JUNIT)$(SEP)$(CP_DERBY) org.junit.runner.JUnitCore orders.OrderTestX
run:
java -cp $(CP_DERBY)$(SEP)$(JUNIT) clients/Main
junit:
java -cp $(JUNIT)$(SEP)$(CP_DERBY) org.junit.runner.JUnitCore orders.OrderTest
junitX:
java -cp $(JUNIT)$(SEP)$(CP_DERBY) org.junit.runner.JUnitCore orders.OrderTestX
distributed:
java -cp $(CP_DERBY) middle/Server &
sleep 1
java clients/backDoor/BackDoorClient&
java clients/customer/CustomerClient&
java clients/cashier/CashierClient&
java clients/warehousePick/PickClient&
java clients/shopDisplay/DisplayClient&
java clients/collection/CollectClient&
database:
java -cp $(CP_DERBY) clients/Setup