-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
51 lines (37 loc) · 1006 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
49
50
51
# Default to compiler found by ./configure:
CC ?= @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@ -g -Wall -I . $(CPPFLAGS)
all: bin/readline
HEADERS = src/readlinesh.h
SRCS = src/main.c src/readlinesh.c
OBJS = $(patsubst %.c,%.o,$(SRCS))
# Support GNU DESTDIR for Debian, etc.
# Cf. http://www.gnu.org/prep/standards/html_node/DESTDIR.html
ifeq ($(DESTDIR),)
INSTALL_PREFIX = @prefix@
else
INSTALL_PREFIX = $(DESTDIR)
endif
-include dist.mk
-include docs/docs.mk
LIBS += @LIBS@
# ^ This should contain -l readline
bin/readline: $(OBJS) bin
$(CC) -o $(@) $(OBJS) $(LDFLAGS) $(LIBS)
%.o: %.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $(@) $(<)
install: $(INSTALL_PREFIX)/bin/readline
$(INSTALL_PREFIX)/bin bin:
mkdir -pv $(@)
$(INSTALL_PREFIX)/bin/readline: bin/readline $(INSTALL_PREFIX)/bin
cp -v $(<) $(@)
README.adoc: README.adoc.m4
m4 -P $(<) > $(@)
clean:
rm -fv bin/readline
rm -fv src/*.o
distclean: clean
rm -fvr autom4te.cache/ config.* configure
rm -fvr bin/
rm Makefile # Bye!