forked from merces/bashacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 703 Bytes
/
Makefile
File metadata and controls
32 lines (25 loc) · 703 Bytes
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
SRC = $(shell find src/ -type f -name '*.sh')
OUTFILE = bashacks.sh
STLANGUAGE = $(shell echo $LANG | cut -d \. -f1)
MANDIR = /usr/share/man/man1
BAHSRCFILE = /etc/bash.bashrc
all:
for file in $(SRC); do \
cat $$file >> $(OUTFILE); \
echo >> $(OUTFILE); \
done
install:
ifeq ("$(wildcard $(OUTFILE))","")
$(error $(OUTFILE) not found. Try: make)
endif
ifeq ($(STLANGUAGE), pt_BR)
install doc/man/pt_BR/bashacks.1 $(MANDIR)
else
install doc/man/en/bashacks.1 $(MANDIR)
endif
echo 'source $(shell pwd)/$(OUTFILE)' >> $(BAHSRCFILE)
clean:
rm -f bashacks.sh
uninstall:
rm -f /usr/share/man/man1/bashacks.1
sed -i '/source $(shell pwd | sed 's/\//\\\//g')\/$(OUTFILE)/d' $(BAHSRCFILE)