f2d469729ce04d7fa14be347c78bafffb14a1bbc
5 print-
%: ; @echo
$*=$($*)
8 include rules
/programs.mk
9 include rules
/javascript.mk
10 include rules
/icons.mk
13 include rules
/pngcrush.mk
15 .PHONY
: all check distclean lint
test dist clean serve
19 VERSION
:= $(call git-describe
)
20 DISTROOT
:= $(DISTDIR
)/$(APPLICATION
)_
$(VERSION
)
22 FIND_FILES
:= -type f
! -name
'.*'
23 FIND_JS
:= -type f
-name
'*.js'
25 SOURCES
:= $(shell cd src
&& find .
$(FIND_FILES
))
26 MY_SOURCES
:= $(shell cd src
&& find .
$(FIND_JS
) -not
-path
'./ext/*')
28 TEST_SOURCES
:= $(shell find
test/spec
$(FIND_JS
))
30 LINT_TARGETS
:= $(call jshint-stampify
,$(MY_SOURCES
))
31 TEST_TARGETS
:= $(call jstest-stampify
,$(TEST_SOURCES
))
33 JSHINTCONFIG
:= test/jshint.config
34 JSTEST_NODE_PATH
:= src
37 ICONSETS
:= $(shell find src
-type d
-name
'*.iconset')
38 ICONS
:= $(ICONSETS
:.iconset
=.icns
) $(ICONSETS
:.iconset
=.ico
)
40 IMAGEGZSRC
:= $(shell find src
-type f
-name
'*.xcf.gz')
41 IMAGESRC
:= $(shell find src
-type f
-name
'*.xcf')
42 IMAGES
:= $(IMAGEGZSRC
:.xcf.gz
=.png
) $(IMAGESRC
:.xcf
=.png
)
44 BUILT
:= $(ICONS
) $(IMAGES
)
46 HTTP_SERVER_PORT ?
= 8000
48 all: check $(BUILT
) $(call pngcrush-stampify
,$(IMAGES
))
53 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
)
64 serve
: |
$(npmbindir
)/http-server
65 $(npmbindir
)/http-server
$(@D
) -p
$(HTTP_SERVER_PORT
) -c-1
74 $(RM
) $(nwjs-archives
)
76 $(DISTROOT
)-src.zip
$(DISTROOT
)-src.
tar.gz
: | .git
78 $(call git-archive
,$@
,$(notdir $(DISTROOT
))/)
80 $(DISTROOT
).bare.zip
: | .git
84 cd src
&& $(GIT
) archive
$(call git-describe
) . |
tar -x
-C ..
/$@.tmp
85 $(MAKE
) $(BUILT
:src
/%=$@.tmp
/%)
86 $(RM
) $(IMAGESRC
:src
/%=$@.tmp
/%) $(IMAGEGZSRC
:src
/%=$@.tmp
/%)
87 cd
$@.tmp
&& $(ZIP
) ..
/$(@F
) -r .
90 %.appcache
: %.bare.zip tools
/generate-appcache
93 tools
/generate-appcache
$@.tmp
96 # Python's zipfile module generates zipfiles that NW.js cannot read,
97 # so delegate to a real zip tool.
98 %.nw
: %.bare.zip tools
/generate-nw
100 $(UNZIP
) -d
$@.tmp
$<
101 tools
/generate-nw
$@.tmp
`echo $(*F) | sed -E 's/.+_[^0-9]+//'`
102 cd
$@.tmp
&& $(ZIP
) -r ..
/$(@F
) .