-
Notifications
You must be signed in to change notification settings - Fork 3
/
GNUmakefile
52 lines (35 loc) · 1.21 KB
/
GNUmakefile
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
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2013, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
PROJECT=$(PWD)
PROJECT_NAME=central-query
JAVADIR=$(PROJECT)
TARGETDIR=$(JAVADIR)/target
INSTALL_DIR ?= $(PROJECT)/install
SUPERVISOR_CONF = $(PROJECT_NAME)_supervisor.conf
SUPERVISORD_DIR = $(INSTALL_DIR)/etc/supervisor
default: build
clean:
cd $(JAVADIR) && mvn clean
build-java:
cd $(JAVADIR) && mvn package
build: build-java
.PHONY: install assemble
ARTIFACT_TAR=$(TARGETDIR)/assembly.tar.gz
$(ARTIFACT_TAR):
cd $(JAVADIR) && mvn package -P assemble
cd $(TARGETDIR) && ln -sf *tar.gz assembly.tar.gz
assemble: $(ARTIFACT_TAR)
echo "debug $(@)"
install:$(ARTIFACT_TAR)
echo "Installing $(PROJECT_NAME) into $(INSTALL_DIR)"
mkdir -p $(INSTALL_DIR)
cd $(INSTALL_DIR) && tar -xvf $(TARGETDIR)/assembly.tar.gz
mkdir -p $(SUPERVISORD_DIR)
ln -sf ../$(PROJECT_NAME)/$(SUPERVISOR_CONF) $(SUPERVISORD_DIR)/$(SUPERVISOR_CONF)
mkdir -p $(INSTALL_DIR)/log