-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
73 lines (59 loc) · 1.8 KB
/
makefile
File metadata and controls
73 lines (59 loc) · 1.8 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
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
# Author: Mikhail Andrenkov
# Date: April 29, 2018
# Version: 1.1
#
# Description: Makefile for cleaning, building, and running the Geoscape application.
#
# Notes:
# 1. Only Windows and Linux distributions are supported.
# 2. Windows users must have Cygwin in their path. Cygwin can be
# downloaded from: https://cygwin.com/install.html.
BUILDPATH = bin
DELETE = rm -rf
DOCPATH = doc
JAR = Geoscape.jar
LIBPATH = lib/native
MAIN = core.Top
MANIFEST = manifest.mf
MKDIR = mkdir -p
LIBJARS = $(wildcard lib/*.jar)
SOURCES = $(wildcard */*.java)
ifeq ($(OS), Windows_NT)
CLASSPATH = ".;$(BUILDPATH);lib/*"
else
CLASSPATH = ".:$(BUILDPATH):lib/*"
endif
# Run the application.
all: run
run: build
@echo "Running main class \"$(MAIN)\"."
@java -classpath $(CLASSPATH) $(MAIN)
# Build the application class files.
build: clean
@$(MKDIR) $(BUILDPATH)
@echo -n "Compiling Java source files..."
@javac -d $(BUILDPATH) -s $(BUILDPATH) -h $(BUILDPATH) -classpath $(CLASSPATH) $(SOURCES)
@echo "done."
# Build the application JAR file.
jar: build
@echo -n "Generating \"$(JAR)\"..."
@# Create a temporary JAR manifest file.
@echo "Manifest-Version: 1.0" > $(MANIFEST)
@echo "Class-Path: $(LIBJARS)" >> $(MANIFEST)
@echo "Main-Class: $(MAIN)" >> $(MANIFEST)
@# Run the Java archiver.
@jar cfm $(JAR) $(MANIFEST) -C $(BUILDPATH) .
@echo "done."
@# Clean the temporary manifest.
@$(DELETE) $(MANIFEST)
# Generate the documentation.
doc: FORCE
@$(MKDIR) $(DOCPATH)
@echo "Generating Javadoc documentation..."
@javadoc -private -classpath $(CLASSPATH) -d doc $(SOURCES)
@echo "The updated documentation is available in the $(DOCPATH)/ directory."
# Delete the build directory.
clean: FORCE
@$(DELETE) $(BUILDPATH)
# Nonexistent file target.
FORCE: