-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (36 loc) · 1.03 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
export BUILDROOT=cobol-build
export PROJECTROOT=..
DBDIR := data
DATABASE := $(DBDIR)/todolist.txt
all: deploy
run-server: deploy
uwsgi --ini uwsgi.conf
debug-server: deploy
mv deploy/cgi-bin/todohandler deploy/cgi-bin/todohandler.orig
# printf '#!/bin/sh\ncat >> /tmp/strace-cgi' > deploy/cgi-bin/todohandler
printf '#!/bin/sh\nstrace -o /tmp/strace-cgi ./todohandler.orig' > deploy/cgi-bin/todohandler
chmod +x deploy/cgi-bin/todohandler
@echo
@echo ">>>"
@echo ">>> DEBUG MODE ENABLED"
@echo ">>> run \`tail -F /tmp/strace-cgi' to see what is happening"
@echo ">>>"
@echo
uwsgi --ini uwsgi.conf
deploy: build test $(DATABASE)
mkdir -p deploy/cgi-bin
cp todoliste/target/TODOHANDLER deploy/cgi-bin/todohandler
ln -fs ../../$(DATABASE) deploy/cgi-bin/todolist.txt
$(DATABASE):
mkdir -p $(DBDIR)
touch $(DATABASE)
clean-data:
rm -rf $(DBDIR)
clean:
$(MAKE) -C $(BUILDROOT) $@
rm -rf deploy
rm *~
build:
$(MAKE) -C $(BUILDROOT) $@
test:
$(MAKE) -C $(BUILDROOT) $@