3 # This is free and unencumbered software released into the public
4 # domain. To the extent possible under law, the author of this file
5 # waives all copyright and related or neighboring rights to it.
8 stampprefix
:= build
/stamp
/
10 include rules
/default.mk
11 $(call include-once
,rules
/*.mk
)
13 .PHONY
: all check clean distclean lint
test dist
16 DISTDIR
:= build
/dist/
17 VERSION
:= $(call git-describe
)
18 DISTROOT
:= $(DISTDIR
)$(APPLICATION
)_
$(VERSION
)
20 MY_SOURCES
:= $(call find-js
,src
-path
'src/ext' -prune
-o
)
21 TEST_SOURCES
:= $(call find-js
,test/spec
)
25 ICONS
:= $(call iconset
>icons
,$(call find-iconsets
,src
))
26 XCFS
:= $(call find-xcfs
,src
)
27 OBJPNGS
:= $(call xcf
>png
,$(XCFS
))
28 PNGS
:= $(call find-files
,src
,-name
'*.png') $(OBJPNGS
)
30 BUILT
:= $(ICONS
) $(OBJPNGS
)
31 CRUSHABLE
:= $(call pngcrush-stampify
,$(PNGS
))
32 LINTABLE
:= $(call jshint-stampify
,$(MY_SOURCES
))
33 TESTABLE
:= $(call jstest-stampify
,$(TEST_SOURCES
))
34 DISTFILES
:= $(addprefix $(DISTROOT
)-,$(nwjs-platforms
))
36 all:: check $(BUILT
) $(CRUSHABLE
)
59 $(DISTROOT
)-src.zip
$(DISTROOT
)-src.
tar.gz
: | .git
61 $(call git-archive
,$@
,$(notdir $(DISTROOT
))/)
63 $(DISTROOT
).bare.zip
: | .git
67 cd src
&& $(GIT
) archive
$(call git-describe
) . |
tar -x
-C ..
/$@.tmp
68 $(MAKE
) $(BUILT
:src
/%=$@.tmp
/%)
69 $(RM
) $(XCFS
:src
/%=$@.tmp
/%)
70 cd
$@.tmp
&& $(ZIP
) ..
/$(@F
) -r .
73 %.appcache
: %.bare.zip tools
/generate-appcache
76 tools
/generate-appcache
$@.tmp
79 # Python's zipfile module generates zipfiles that NW.js cannot read,
80 # so delegate to a real zip tool.
81 %.nw
: %.bare.zip tools
/generate-nw
84 tools
/generate-nw
$@.tmp
`echo $(*F) | sed -E 's/.+_[^0-9]+//'`
85 cd
$@.tmp
&& $(ZIP
) -r ..
/$(@F
) .