-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
36 lines (31 loc) · 1.05 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
TAG=$(shell git describe --exact-match --tags 2>/dev/null)
COMMIT=$(shell echo "cloned commit: " && git rev-parse --short HEAD 2>/dev/null)
VER=$(or $(TAG),$(COMMIT))
all:
mkdir -p build
rm -rf build/*
mkdir -p build/bin
mkdir -p build/share
mkdir -p build/share/ptSh
mkdir -p build/share/licenses
mkdir -p build/share/licenses/ptSh
gcc src/common/*.c src/ptls/*.c -lm -o build/bin/ptls
gcc src/common/*.c src/ptpwd/*.c -lm -o build/bin/ptpwd
gcc src/common/*.c src/ptcp/*.c -lm -o build/bin/ptcp
cp src/ptsh.sh build/bin/ptsh
cp src/config build/share/ptSh/config
cp LICENSE build/share/ptSh/LICENSE
cp LICENSE build/share/licenses/ptSh/LICENSE
cp src/logo.txt build/share/ptSh/logo.txt
echo "Version: " | tee build/share/ptSh/version.txt
echo $(VER) | tee -a build/share/ptSh/version.txt
install:
cp -R build/* $(DESTDIR)/usr
$(DESTDIR)/usr/bin/ptsh
uninstall:
rm -rf $(DESTDIR)/usr/share/ptSh
rm $(DESTDIR)/usr/bin/ptls
rm $(DESTDIR)/usr/bin/ptpwd
rm $(DESTDIR)/usr/bin/ptcp
rm $(DESTDIR)/usr/bin/ptsh
rm -rf $(DESTDIR)/usr/share/licenses/ptSh