-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (50 loc) · 1.69 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
TARGET=sao-file-server
VERSION=0.7
SECTION=Web Software
ARCHITECTURE=all
DEPENDS=apache2, php, php-common, libapache2-mod-php, php-mysql, php-json, mariadb-server
DESCRIPTION=SAO File server is a tiny web file server
MAINTAINER=Julio A. Garcia Lopez
# Installation sources and destination
SOURCES=fileserver
BUILDCMD=echo "No hace falta compilar nada"
BUILDOUTPUT=fileserver
INSROOT=/var/www/html/sfs
# For building .tgz
TARNAME=$(TARGET)-$(VERSION).tgz
# For building .deb filesS
DEBTMPPATH=$(TARGET)-$(VERSION)
DEBCTRLDIR=$(TARGET)-$(VERSION)/DEBIAN
DEBCTRLFILE=$(TARGET)-$(VERSION)/DEBIAN/control
PHPFILES=$(shell find . -name *.php)
.phony:help clean deb
test:
for i in $(PHPFILES); do \
php -l $$i; if test $$? -ne 0; then exit 1; fi; done
help:
@echo "USE:"
@echo "make help: Show this help"
@echo "make clean: Cleans all building results/intermediates"
@echo "make tgz: Creates a tgz with sao-file-server"
@echo "make deb: Generate web package"
clean:
-rm -f $(TARNAME)
-rm -rf $(DEBTMPPATH)*
find . -name '~*' -delete
$(BUILDOUTPUT): $(SOURCES)
$(BUILDCMD)
tgz: clean $(BUILDOUTPUT)
tar cvzf $(TARNAME) $(BUILDOUTPUT) --exclude=.svn --exclude=.git
deb: clean $(BUILDOUTPUT)
mkdir -p $(DEBTMPPATH)$(INSROOT)
cp -rf $(BUILDOUTPUT)/* $(DEBTMPPATH)/$(INSROOT)
mkdir -p $(DEBCTRLDIR)
@echo Package: $(TARGET) > $(DEBCTRLFILE)
@echo Version: $(VERSION) >> $(DEBCTRLFILE)
@echo Section: $(SECTION) >> $(DEBCTRLFILE)
@echo Architecture: $(ARCHITECTURE) >> $(DEBCTRLFILE)
@echo Depends: $(DEPENDS) >> $(DEBCTRLFILE)
@echo Maintainer: $(MAINTAINER) $(MAIL) >> $(DEBCTRLFILE)
@echo Description: $(DESCRIPTION) >> $(DEBCTRLFILE)
fakeroot dpkg-deb --build $(DEBTMPPATH)