forked from greglook/cljstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (35 loc) · 1.17 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
# Build file for cljstyle
.PHONY: all clean package
version := $(shell grep defproject core/project.clj | cut -d ' ' -f 3 | tr -d \")
platform := $(shell uname -s | tr '[:upper:]' '[:lower:]')
release_name = cljstyle_$(version)_$(platform)
lib_install_path := $(HOME)/.m2/repository/mvxcvi/cljstyle/$(version)/cljstyle-$(version).jar
tool_uberjar_path := tool/target/uberjar/cljstyle.jar
# Rewrite darwin as a more recognizable OS
ifeq ($(platform),darwin)
platform := macos
endif
# Ensure Graal is available
ifndef GRAAL_HOME
$(error GRAAL_HOME is not set)
endif
all: cljstyle
clean:
rm -rf dist cljstyle core/target tool/target
$(lib_install_path): core/project.clj core/src/**/* core/resources/**/*
cd core; lein install
$(tool_uberjar_path): tool/project.clj tool/src/**/* $(lib_install_path)
cd tool; lein uberjar
cljstyle: $(tool_uberjar_path)
$(GRAAL_HOME)/bin/native-image \
--no-fallback \
--allow-incomplete-classpath \
--report-unsupported-elements-at-runtime \
--initialize-at-build-time \
-J-Xms3G -J-Xmx3G \
--no-server \
-jar $<
dist/$(release_name).tar.gz: cljstyle
@mkdir -p dist
tar -cvzf $@ $^
package: dist/$(release_name).tar.gz