-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (32 loc) · 792 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
#!/usr/bin/env make -f
# Makefile to update and build djifix
prefix=/usr/local
url="https://djifix.live555.com/djifix.c"
version=$(shell grep 'versionStr = ' djifix.c | sed 's/.*"\(.*\)".*/\1/')
.PHONY: all build clean install update commit release version
all: build
build: djifix
djifix: djifix.c
$(CC) $(CFLAGS) -O -o djifix djifix.c
clean:
rm djifix
install: djifix
install -d $(prefix)/bin
install -s -m 0755 djifix $(prefix)/bin
update:
curl -s $(url) -o tmp.txt
@if [ -s tmp.txt ]; then \
mv tmp.txt djifix.c; \
else \
rm tmp.txt; \
fi
commit:
@if git diff --quiet --exit-code djifix.c; then \
echo "No changes to commit in djifix.c."; \
else \
git commit djifix.c -m "Version $(version)"; \
fi
release:
git push origin master
version:
@echo $(version)