My favorites | Sign in
Project Logo
             
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
65
66
67
68
69
70
71
72
73
74
75
76
77
# Makefile to build all plugins
# Author: Ariel Flesler
# --
# Runs on a linux-based enviroment (Cygwin can be used on Windows).
# In order to minify, it requires the YUI compressor.
# You must set the $YUI enviroment variable with the jar's path.

NAME=${shell basename $(value PWD)}
VER?=unversioned

SRC=$(NAME).js
MIN=$(NAME)-min.js

VER_NAME=$(NAME)-$(VER)

SRCV=$(VER_NAME).js
MINV=$(VER_NAME)-min.js

ZIP=$(VER_NAME).zip
ZIP_FILES += $(SRC) $(MIN) changes.txt

all: deploy

# Deploy Files

$(ZIP): $(ZIP_FILES)
zip -r9 $(ZIP) $(ZIP_FILES)

zip:$(ZIP)

deploy:$(ZIP) $(SRCV) $(MINV)

# Source File
# $(SRC) is not .PHONY so you need to do make -B to make it run
$(SRC):
$(add-version) -i $(SRC)
$(add-date) -i $(SRC)

src:$(SRC)

$(SRCV):$(SRC)
cp $(SRC) $(SRCV)

# Minified File

$(MIN):$(SRC)
java -jar $(YUI) $(SRC) -o $(MIN)

min: $(MIN)

$(MINV):$(MIN)
cp $(MIN) $(MINV)

# ---Replacements--- #

# Version
define add-version
sed -e 's/^\(.*@version \)[0-9a-z.]\+\(.*\)$|/\1$(VER)\2/'
endef

# Date
TODAY=${shell date +%m\\/%d\\/%Y}
define add-date
sed -e 's/^\(.*Date: \)[0-9/]\+\(.*\)$|/\1$(TODAY)\2/'
endef

# ---Cleaning--- #

# Can be extended
define cmd-clean
rm -f $(MIN) $(SRCV) $(MINV) $(ZIP);
endef

clean:
$(cmd-clean)

.PHONY: clean deploy min
Show details Hide details

Change log

r16 by aflesler on Jul 23, 2009   Diff
  * Moving the scrollTo (dependency)
makefile to a top level makefile
Go to: 
Sign in to write a code review

Older revisions

r14 by aflesler on Jun 14, 2009   Diff
  * serialScroll 1.2.2
  * The makefile doesn't re-build the
source unless it gets -B
r10 by aflesler on Jun 06, 2009   Diff
  * Adding a header to common.mak
r9 by aflesler on Jun 05, 2009   Diff
  * Avoiding the temp file to build
SRC files
All revisions of this file

File info

Size: 1283 bytes, 77 lines
Hosted by Google Code