-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.in
48 lines (36 loc) · 948 Bytes
/
Makefile.in
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
NAME = cmdalias
SRC = src/cmdalias.c src/alias.c src/list.c src/parser.c src/lexer.c
OBJ = $(SRC:.c=.o)
CFLAGS = -I./include @CFLAGS@
LDFLAGS= @LDFLAGS@ @LIBS@
prefix = @prefix@
CC=@CC@
YACC=@YACC@
LEX=@LEX@
${NAME}: ${OBJ}
${CC} ${CFLAGS} ${CPPFLAGS} ${OBJ} -o ${NAME} ${LDFLAGS}
.PHONY: build
build: ${NAME}
${CC} ${CFLAGS} ${CPPFLAGS} ${NAME} -c ${OBJ} ${LDFLAGS}
src/bash_autocomplete.c: autocomplete.bash
xxd -i $^ $@
src/cmdalias.c: src/bash_autocomplete.c
src/parser.c: src/parser.y
$(YACC) -d $^ -o$@
src/lexer.c: src/lexer.l
$(LEX) $(LFLAGS) -o$@ $^
.PHONY: clean
clean:
rm -f ${OBJ} *~ src/parser.c src/parser.h src/lexer.c
rm -f ${NAME}
.PHONY: distclean
distclean: clean
find . -name '*.in' | sed 's#\.in##g' | xargs rm -f
rm -f ${NAME} config.log config.status
.PHONY: install
install: ${NAME}
cp cmdalias ${prefix}/bin
chmod a+x ${prefix}/bin/cmdalias
.PHONY: uninstall
uninstall:
rm -f ${prefix}/bin/cmdalias