3 node-webkit-version
:= 0.10.4
6 include rules
/programs.mk
7 include rules
/javascript.mk
10 include rules
/node-webkit.mk
11 include rules
/pngcrush.mk
13 .PHONY
: all check distclean lint
test dist clean serve
17 VERSION
:= $(call git-describe
)
18 DISTROOT
:= $(DISTDIR
)/$(APPLICATION
)_
$(VERSION
)
20 FIND_FILES
:= -type f
! -name
'.*'
21 FIND_JS
:= -type f
-name
'*.js'
23 SOURCES
:= $(shell cd src
&& find .
$(FIND_FILES
))
24 MY_SOURCES
:= $(shell cd src
&& find .
$(FIND_JS
) -not
-path
'./ext/*')
26 TEST_SOURCES
:= $(shell find
test/spec
$(FIND_JS
))
28 LINT_TARGETS
:= $(call jshint-stampify
,$(MY_SOURCES
))
29 TEST_TARGETS
:= $(call jstest-stampify
,$(TEST_SOURCES
))
31 JSHINTCONFIG
:= test/jshint.config
32 JSTEST_NODE_PATH
:= src
35 ICONSETS
:= $(shell find src
-type d
-name
'*.iconset')
36 ICONS
:= $(ICONSETS
:.iconset
=.icns
) $(ICONSETS
:.iconset
=.ico
)
38 IMAGEGZSRC
:= $(shell find src
-type f
-name
'*.xcf.gz')
39 IMAGESRC
:= $(shell find src
-type f
-name
'*.xcf')
40 IMAGES
:= $(IMAGEGZSRC
:.xcf.gz
=.png
) $(IMAGESRC
:.xcf
=.png
)
42 BUILT
:= $(ICONS
) $(IMAGES
)
44 HTTP_SERVER_PORT ?
= 8000
46 all: check $(BUILT
) $(call pngcrush-stampify
,$(IMAGES
))
51 dist: $(addprefix $(DISTROOT
),-src.zip
-src.
tar.gz .appcache .nw
-osx-ia32.zip
-osx-x64.zip
-linux-ia32.
tar.gz
-linux-x64.
tar.gz
-win-ia32.zip
)
62 serve
: |
$(npmbindir
)/http-server
63 $(npmbindir
)/http-server
$(@D
) -p
$(HTTP_SERVER_PORT
) -c-1
72 $(RM
) $(node-webkit-archives
)
74 $(DISTROOT
)-src.zip
$(DISTROOT
)-src.
tar.gz
: | .git
76 $(call git-archive
,$@
,$(notdir $(DISTROOT
))/)
78 $(DISTROOT
).bare.zip
: | .git
82 cd src
&& $(GIT
) archive
$(call git-describe
) . |
tar -x
-C ..
/$@.tmp
83 $(MAKE
) $(BUILT
:src
/%=$@.tmp
/%)
84 $(RM
) $(IMAGESRC
:src
/%=$@.tmp
/%) $(IMAGEGZSRC
:src
/%=$@.tmp
/%)
85 cd
$@.tmp
&& $(ZIP
) ..
/$(@F
) -r .
88 %.appcache
: %.bare.zip tools
/generate-appcache
91 tools
/generate-appcache
$@.tmp
94 # Python's zipfile module generates zipfiles that node-webkit cannot
95 # read, so delegate to a real zip tool.
96 %.nw
: %.bare.zip tools
/generate-nw
99 tools
/generate-nw
$@.tmp
`echo $(*F) | sed -E 's/.+_[^0-9]+//'`
100 cd
$@.tmp
&& $(ZIP
) -r ..
/$(@F
) .