forked from Genivia/ugrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
85 lines (74 loc) · 3.51 KB
/
Makefile.am
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
SUBDIRS = lib src
man1_MANS = man/ugrep.1
EXTRA_DIST = README.md LICENSE.txt CONTRIBUTING.md CODE_OF_CONDUCT.md
UGREP = $(shell pwd)/$(top_builddir)/bin/ugrep$(EXEEXT)
CONFIGH = $(shell pwd)/$(top_builddir)/config.h
all-local: cp2bin
.PHONY: cp2bin
# to copy the ugrep binary to the local ugrep/bin/ugrep and link ugrep/bin/ug
cp2bin: $(top_builddir)/src/ugrep$(EXEEXT)
mkdir -p $(top_builddir)/bin; \
cp -f $< $(top_builddir)/bin/ugrep$(EXEEXT); \
cd $(top_builddir)/bin; \
rm -f ug$(EXEEXT); \
$(LN_S) ugrep$(EXEEXT) ug$(EXEEXT)
@echo
@echo "OK"
@echo
install-exec-hook:
rm -f $(DESTDIR)$(bindir)/ug$(EXEEXT)
cd $(DESTDIR)$(bindir) && $(LN_S) ugrep$(EXEEXT) ug$(EXEEXT)
install-data-hook:
mkdir -p $(DESTDIR)$(datadir)/ugrep && \
cp -rf patterns $(DESTDIR)$(datadir)/ugrep/
cd $(DESTDIR)$(mandir)/man1; \
rm -f ug.1; \
$(LN_S) ugrep.1 ug.1
@echo " ______________________________________________________ "; \
echo "| |"; \
echo "| You have successfully built and installed ugrep. |"; \
echo "| |"; \
echo "| You can use the ugrep & ug commands to search files. |"; \
echo "| |"; \
echo "| The ugrep command is for batch use, whereas the ug |"; \
echo "| command is intended for interactive searches using |"; \
echo "| a .ugrep configuration file with your preferences, |"; \
echo "| located in the working directory or home directory. |"; \
echo "| Run 'ug --save-config' to create a .ugrep file. |"; \
echo "| |"; \
echo "| Aliases to consider: |"; \
echo "| alias uq = 'ug -Q' |"; \
echo "| alias ux = 'ug -UX' |"; \
echo "| alias uz = 'ug -z' |"; \
echo "| alias grep = 'ugrep -G' |"; \
echo "| alias egrep = 'ugrep -E' |"; \
echo "| alias fgrep = 'ugrep -F' |"; \
echo "| alias pgrep = 'ugrep -P' |"; \
echo "| alias xgrep = 'ugrep -UX' |"; \
echo "| alias zgrep = 'ugrep -zG' |"; \
echo "| alias zegrep = 'ugrep -zE' |"; \
echo "| alias zfgrep = 'ugrep -zF' |"; \
echo "| alias zpgrep = 'ugrep -zP' |"; \
echo "| alias zxgrep = 'ugrep -zUX' |"; \
echo "| alias xdump = 'ugrep -X \"\"' |"; \
echo "| |"; \
echo "| Thank you for using ugrep! |"; \
echo "| |"; \
echo "| https://github.com/Genivia/ugrep |"; \
echo "|______________________________________________________|";
uninstall-hook:
rm -f $(DESTDIR)$(bindir)/ug$(EXEEXT)
rm -rf $(DESTDIR)$(datadir)/ugrep
.PHONY: test
test: ${UGREP}
@echo
@echo "*** SINGLE-THREADED TESTS ***"
@echo
cd $(top_srcdir)/tests && env UGREP_ABS_PATH=${UGREP} CONFIGH_ABS_PATH=${CONFIGH} ./verify.sh -J1
@echo
@echo "*** MULTI-THREADED TESTS ***"
@echo
cd $(top_srcdir)/tests && env UGREP_ABS_PATH=${UGREP} CONFIGH_ABS_PATH=${CONFIGH} ./verify.sh
@echo
@echo "OK"
@echo