-
Notifications
You must be signed in to change notification settings - Fork 1
/
genmakefile.pl
64 lines (55 loc) · 1.44 KB
/
genmakefile.pl
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
56
57
58
59
60
61
62
63
64
print <<FOO;
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = \$(SHELL) -c true
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
MKPATH = mkdir -p
CAT = cat
MAKE = make
OPEN = open
ECHO = echo
ECHO_N = echo -n
JAVA = java
DOXYGEN =
IPHONE_DOCSET_TMPDIR = docs/iphone/tmp
YUI = '../../util/yuicompressor-2.4.2.jar'
NAME = $ARGV[1]
NAME_MIN = $ARGV[1]-min
all :: \$(NAME)
clean :: clean_libs
clean_libs:
\$(RM_RF) js/\$(NAME_MIN).js
\$(RM_RF) js/\$(NAME).js
www/\$(NAME).js: js/\$(NAME_MIN).js
\$(CP) js/\$(NAME_MIN).js \$@
\$(NAME): js/\$(NAME_MIN).js
js/\$(NAME_MIN).js: js/\$(NAME).js
\$(JAVA) -jar \$(YUI) --charset UTF-8 -o \$@ js/\$(NAME).js
js/config/config_dev.js:
echo "" \> js/config/config_dev.js
FOO
open(FILE, $ARGV[0]);
print "js/\$(NAME).js: ";
while(<FILE>) {
if (m{<script src="(\S*?)"} && $1 ne "phonegap.js" && $1 ne "js/\$(NAME).js" && $1 ne "js/\$(NAME_MIN).js" && $1 ne "js/common/contrib/jquery-1.4.2.min.js" && $1 ne "js/common/contrib/iscroll-3.6b1.min.js") {
print "$1\ ";
}
}
close(FILE);
print "\n";
print " \$\(RM_F\) \$\@\n";
open(FILE, $ARGV[0]);
while(<FILE>) {
if (m{<script src="(\S*?)"} && $1 ne "phonegap.js" && $1 ne "js/\$(NAME).js" && $1 ne "js/\$(NAME_MIN).js" && $1 ne "js/common/contrib/jquery-1.4.2.min.js" && $1 ne "js/common/contrib/iscroll-3.6b1.min.js") {
print "\t\$(CAT) $1\ \>\> \$\@\n";
print "\t\$(ECHO) \";\" \>\> \$\@\n";
}
}
close(FILE);