Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 91 lines (77 sloc) 2.417 kb
8cde8ee @orlandov Update Makefile release targets
orlandov authored
1 #
2 # Copyright (c) 2012, Joyent, Inc. All rights reserved.
3 #
4 # Makefile: basic Makefile for template API service
5 #
6 # This Makefile is a template for new repos. It contains only repo-specific
7 # logic and uses included makefiles to supply common targets (javascriptlint,
8 # jsstyle, restdown, etc.), which are used by other repos as well. You may well
9 # need to rewrite most of this file, but you shouldn't need to touch the
10 # included makefiles.
11 #
12 # If you find yourself adding support for new targets that could be useful for
13 # other projects too, you should add these to the original versions of the
14 # included Makefiles (in eng.git) so that other teams can use them too.
15 #
16
17 #
18 # Tools
19 #
20 TAP := ./node_modules/.bin/tap
21
22 #
23 # Files
24 #
6816926 @orlandov Rename REPO_ROOT => ROOT
orlandov authored
25 ROOT = $(shell pwd)
26 DOC_FILES = index.restdown boilerplateapi.restdown
e96bdce @orlandov Add eng Makefiles
orlandov authored
27 JS_FILES := $(shell ls *.js 2>/dev/null) $(shell find lib -name '*.js' 2>/dev/null)
6816926 @orlandov Rename REPO_ROOT => ROOT
orlandov authored
28 JSL_CONF_NODE = tools/jsl.node.conf
e96bdce @orlandov Add eng Makefiles
orlandov authored
29 JSL_FILES_NODE = $(JS_FILES)
6816926 @orlandov Rename REPO_ROOT => ROOT
orlandov authored
30 JSSTYLE_FILES = $(JS_FILES)
e96bdce @orlandov Add eng Makefiles
orlandov authored
31 JSSTYLE_FLAGS = -o indent=4,doxygen,unparenthesized-return=0
32
33 NODE_PREBUILT_VERSION=v0.6.19
34 NODE_PREBUILT_TAG=gz
8cde8ee @orlandov Update Makefile release targets
orlandov authored
35
36 include ./tools/mk/Makefile.defs
e96bdce @orlandov Add eng Makefiles
orlandov authored
37 include ./tools/mk/Makefile.node_prebuilt.defs
8cde8ee @orlandov Update Makefile release targets
orlandov authored
38 include ./tools/mk/Makefile.node_deps.defs
39 include ./tools/mk/Makefile.smf.defs
40
41 #
42 # Repo-specific targets
43 #
44 .PHONY: all
45 all: | $(TAP) $(REPO_DEPS)
46 $(NPM) rebuild
47
48 $(TAP): | $(NPM_EXEC)
49 $(NPM) install
50
51 CLEAN_FILES += $(TAP) ./node_modules/tap
52
53 ROOT := $(shell pwd)
54 RELEASE_TARBALL := convertvm-$(STAMP).tar.bz2
55 TMPDIR := /tmp/$(STAMP)
56
57 .PHONY: test
58 test: $(TAP)
59 TAP=1 $(TAP) test/*.test.js
60
61 .PHONY: release
62 release: all deps #docs
63 @echo "Building $(RELEASE_TARBALL)"
64 @mkdir -p $(TMPDIR)/convertvm
65 cp -r $(ROOT)/build \
66 $(ROOT)/bin \
67 $(ROOT)/lib \
68 $(ROOT)/Makefile \
69 $(ROOT)/node_modules \
70 $(ROOT)/package.json \
71 $(ROOT)/tools \
72 $(TMPDIR)/convertvm
73 (cd $(TMPDIR) && $(TAR) -jcf $(ROOT)/$(RELEASE_TARBALL) convertvm)
74 @rm -rf $(TMPDIR)
75
0f7a2d4 @orlandov TOOLS-136: Add publish target to Makefile
orlandov authored
76 .PHONY: publish
77 publish: release
78 @if [[ -z "$(BITS_DIR)" ]]; then \
79 echo "error: 'BITS_DIR' must be set for 'publish' target"; \
80 exit 1; \
81 fi
82 mkdir -p $(BITS_DIR)/convertvm
83 cp $(ROOT)/$(RELEASE_TARBALL) $(BITS_DIR)/convertvm/$(RELEASE_TARBALL)
84
8cde8ee @orlandov Update Makefile release targets
orlandov authored
85
86 include ./tools/mk/Makefile.deps
e96bdce @orlandov Add eng Makefiles
orlandov authored
87 include ./tools/mk/Makefile.node_prebuilt.targ
8cde8ee @orlandov Update Makefile release targets
orlandov authored
88 include ./tools/mk/Makefile.node_deps.targ
89 include ./tools/mk/Makefile.smf.targ
90 include ./tools/mk/Makefile.targ
Something went wrong with that request. Please try again.