-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
45 lines (36 loc) · 1.19 KB
/
Makefile
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
# Makefile for build Codestriker distribution.
# Path to utilities.
RM = /bin/rm
CP = /bin/cp
MKDIR = /bin/mkdir
RSYNC = rsync
ZIP = zip
TAR = /bin/tar
# Retrieve the current Codestriker version.
VERSION := $(shell cat lib/Codestriker.pm | perl -ne 'print $$1 if /Codestriker::VERSION\s*=\s*\"(.*)\"/')
# The build directory.
BUILD_DIR = build/codestriker-$(VERSION)
default: build-zip build-tar-gz
build-zip: build
cd build ; \
$(ZIP) -r -l codestriker-$(VERSION).zip codestriker-$(VERSION) -x *.png -x *.pdf ; \
$(ZIP) -r codestriker-$(VERSION).zip codestriker-$(VERSION) -i *.pdf -i *.png
build-tar-gz: build
cd build ; \
$(TAR) zcvf codestriker-$(VERSION).tar.gz codestriker-$(VERSION)
build: build-docs
$(RM) -fr $(BUILD_DIR)
$(MKDIR) -p $(BUILD_DIR)
$(RSYNC) -Cavz bin/ $(BUILD_DIR)/bin/
chmod +x $(BUILD_DIR)/bin/*
$(RSYNC) -Cavz lib/ $(BUILD_DIR)/lib/
$(RSYNC) -Cavz html/ $(BUILD_DIR)/html/
$(RSYNC) -Cavz cgi-bin/ $(BUILD_DIR)/cgi-bin/
$(RSYNC) -Cavz template/ $(BUILD_DIR)/template
$(CP) codestriker.conf README CHANGELOG HACKING LICENSE $(BUILD_DIR)
build-docs:
cd doc ; $(MAKE)
clean:
cd doc ; $(MAKE) clean
$(RM) -fr build
$(RM) -f html/*.html html/*.pdf html/*.rtf html/*.png