-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (64 loc) · 1.86 KB
/
Copy pathMakefile
File metadata and controls
82 lines (64 loc) · 1.86 KB
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
78
79
80
81
#
# airScore Makefile
#
# Author: Geoff Wong 2007/2008
# Copying: GPLv2, see the file Copying included
# with this software, or see www.gnu.org if it wasn't provided.
#
TARGET=airScore
DIR=airscore
VERSION=0.99
HTROOT=/var/www/html
# Configure these
MYSQLHOST=localhost
MYSQLUSER=xc
MYSQLPASSWORD=xxxxx
CGIBIN=/usr/lib/cgi-bin/
TRACKDIR=/var/airscore/tracks/
DATABASE=xcdb
INSTALL=install
MAKE=make
TARGET_OS=$(shell uname)
OBJPATH=obj/$(TARGET_OS)/
DEFS=-D_REENTRANT -D$(TARGET_OS)
HTML=$(shell echo *.png *.css)
PHP_SRC=$(shell echo *.php *.js)
BIN=$(shell echo *.pl *.pm)
SQL=$(shell grep -l MYSQLPASSWORD *.php *.pl *.pm *.sql)
LIBS=
all: passwords install
@echo Installing scripts in $(HTROOT) and $(CGIBIN)
database: passwords
@echo Creating the database for the first time
mysql -u root -p < xcdb.sql
install:
mkdir -p $(CGIBIN)
mkdir -p $(TRACKDIR)
$(INSTALL) -m 0755 $(BIN) $(CGIBIN)
mkdir -p $(HTROOT)
$(INSTALL) -m 0644 $(HTML) $(HTROOT)
$(INSTALL) -m 0644 $(PHP_SRC) $(HTROOT)
cp -r images $(HTROOT)
package:
-rm ../$(DIR)-$(VERSION)
cd ..; ln -s airscore $(DIR)-$(VERSION)
cd ..; tar zcfh $(DIR)_$(VERSION).tar.gz $(DIR)-$(VERSION) --exclude debian --exclude .git --exclude bin --exclude build
cd ..; tar zcfh $(DIR)_$(VERSION).orig.tar.gz $(DIR)-$(VERSION) --exclude debian --exclude .git --exclude bin --exclude build
pwd; debuild -m$(MAINTAINER) -aarmel -i.git -I.git -us -uc
-rm ../$(DIR)-$(VERSION)
-cd ..; mv $(DEBS) package
release:
$(shell cd ..; tar jcf $(TARGET)-$(VERSION).tar.bz2 airscore --exclude=.git)
tags: $(SRC)
ctags $^
clean:
rm -f $(TARGET) $(OBJ)
.PHONY:
passwords:
@./submacro.sh MYSQLHOST $(MYSQLHOST)
@./submacro.sh MYSQLUSER $(MYSQLUSER)
@./submacro.sh MYSQLPASSWORD $(MYSQLPASSWORD)
@./submacro.sh CGIBIN $(CGIBIN)
@./submacro.sh VERSION $(VERSION)
@./submacro.sh TRACKDIR $(TRACKDIR)
@./submacro.sh DATABASE $(DATABASE)