forked from ThoughtWorksInc/infra-problem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (24 loc) · 783 Bytes
/
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
BUILD_DIR=build
APPS=front-end quotes newsfeed
LIBS=common-utils
STATIC_BASE=front-end/public
STATIC_PATHS=css
STATIC_ARCHIVE=$(BUILD_DIR)/static.tgz
INSTALL_TARGETS=$(addsuffix .install, $(LIBS))
APP_JARS=$(addprefix $(BUILD_DIR)/, $(addsuffix .jar, $(APPS)))
all: $(BUILD_DIR) $(APP_JARS) $(STATIC_ARCHIVE)
libs: $(INSTALL_TARGETS)
static: $(STATIC_ARCHIVE)
%.install:
cd $* && lein install
test: $(addsuffix .test, $(LIBS) $(APPS))
%.test:
cd $* && lein midje
clean:
rm -rf $(BUILD_DIR) $(addsuffix /target, $(APPS))
$(APP_JARS): | $(BUILD_DIR)
cd $(notdir $(@:.jar=)) && lein uberjar && cp target/uberjar/*-standalone.jar ../$@
$(STATIC_ARCHIVE): | $(BUILD_DIR)
tar -c -C $(STATIC_BASE) -z -f $(STATIC_ARCHIVE) $(STATIC_PATHS)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)