-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (32 loc) · 1.09 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
SRCDIR := src/main/java
LIBDIR := ..
OUTDIR := target
JAVAC := javac
JAVAC_OPTS := -source 1.6 -target 1.6 $(JAVAC_OPTS)
JAR := jar
NAME := coinfloor-client
MAINCLASS := uk.co.coinfloor.client.SwingClient
LIBRARIES := $(wildcard $(addprefix $(LIBDIR)/, \
bcprov-jdk15on-*.jar bcprov-jdk15on.jar \
coinfloor-library-*.jar coinfloor-library.jar \
))
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
CLASSPATH := $(subst $(SPACE),:,$(LIBRARIES))
COMMIT := $(shell git describe --always --dirty)
ifeq ($(COMMIT),)
JARFILE := $(OUTDIR)/$(NAME).jar
else
JARFILE := $(OUTDIR)/$(NAME)-g$(COMMIT).jar
endif
.PHONY : default all tests clean
default : all
all : $(JARFILE)
clean :
rm -rf '$(OUTDIR)'
$(JARFILE) : $(shell find '$(SRCDIR)' -type d -o -name '*.java')
rm -rf '$(OUTDIR)'
mkdir -p '$(OUTDIR)/classes'
find '$(SRCDIR)' -name '*.java' -print0 | xargs -0 -r $(JAVAC) $(JAVAC_OPTS) -sourcepath '$(SRCDIR)' -d '$(OUTDIR)/classes' -cp '$(CLASSPATH)'
echo 'Class-Path: $(subst $(LIBDIR)/,,$(LIBRARIES))' > '$(OUTDIR)/Manifest'
$(JAR) -cfme '$(JARFILE)' '$(OUTDIR)/Manifest' '$(MAINCLASS)' -C '$(OUTDIR)/classes' .