-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (37 loc) · 948 Bytes
/
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
#Makefile for Watchdog
#Bash scripts aren't compiled, but used for install
#Suggested usage: git pull
# sudo make install
INSTALLDIR = /opt/wmfo/songFlagger
OWNER = root
MOD = 644
CREDSMOD = 600
FILES = songFlagger.sh getSongData.php spinpapi.inc.php
CREDS = credentials.php
.PHONY: all install uninstall
all:
@echo "make: nothing to build for bash scripts"
@echo "make: suggested usage: sudo make install"
install: $(addprefix $(INSTALLDIR)/, $(FILES)) $(INSTALLDIR)/$(CREDS)
$(CREDS):
@chown $(OWNER) $@
@chmod $(CREDSMOD) $@
$(INSTALLDIR)/$(CREDS): $(CREDS)
@mkdir -p $(INSTALLDIR)
@cp $< $@
@chown $(OWNER) $@
@chmod $(CREDSMOD) $@
$(INSTALLDIR)/%.php: %.php
@mkdir -p $(INSTALLDIR)
@cp $< $@
@chown $(OWNER) $@
@chmod $(MOD) $@
$(INSTALLDIR)/%.sh: %.sh
@mkdir -p $(INSTALLDIR)
@cp $< $@
@chown $(OWNER) $@
@chmod $(MOD) $@
uninstall:
for file in $(FILES); do \
$(RM) $(INSTALLDIR)/$$file ; \
done