-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
55 lines (39 loc) · 1.18 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
48
49
50
51
52
53
54
55
.PHONY: all commit amdjs-tests
define ensure_buildable
@mkdir -p $(dir $1)
endef
config ?= debug
all: dist/unrequire.js
commit: dist/unrequire.js
git add $^
BUILD_FILES = build/build.sh Makefile
UNREQUIRE_JS = lib/unrequire.js
ALL_PLUGINS = \
lib/browser.js \
lib/spaceport-swf.js \
lib/spaceport.js
# lib/commonjs.js \
# lib/node.js \
BUILD_OPTS ?=
ifeq (debug,$(config))
BUILD_OPTS += --no-compress
else ifeq (release,$(config))
BUILD_OPTS += --compress
else
error := $(error "invalid config $(config); config can be one of: debug release")
endif
dist/unrequire.js: $(BUILD_FILES) $(UNREQUIRE_JS) $(ALL_PLUGINS)
build/build.sh --output $@ $(BUILD_OPTS) -- $(ALL_PLUGINS)
####################
# AMD test suite
amdjs-tests: amdjs-tests/impl/unrequire
amdjs-tests/impl/unrequire: amdjs-tests/impl/unrequire/unrequire.js amdjs-tests/impl/unrequire/config.js
AMD_PLUGINS = \
lib/browser.js \
lib/commonjs.js
amdjs-tests/impl/unrequire/unrequire.js: $(BUILD_FILES) $(UNREQUIRE_JS) $(AMD_PLUGINS)
$(call ensure_buildable,$@)
build/build.sh --output $@ --no-compress -- $(AMD_PLUGINS)
amdjs-tests/impl/unrequire/config.js: tests/amd-config.js
$(call ensure_buildable,$@)
cp $< $@