-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
49 lines (35 loc) · 1.25 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
37
38
39
40
41
42
43
44
45
46
47
48
49
include config.mk
.PHONY: all install uninstall filter clean test dist
all: lchat
clean:
rm -f lchat *.o *.core sl_test filter/indent
install: lchat
cp lchat $(DESTDIR)$(BINDIR)
cp lchat.1 $(DESTDIR)$(MAN1DIR)
uninstall:
rm -f $(DESTDIR)$(BINDIR)/lchat $(DESTDIR)$(MAN1DIR)/lchat.1
test: sl_test
./sl_test
dist:
mkdir -p lchat-$(VERSION)
cp -r $$(git ls-tree --name-only HEAD) lchat-$(VERSION)
tar -czf lchat-$(VERSION).tar.gz lchat-$(VERSION)
rm -fr lchat-$(VERSION)
lchat: lchat.o slackline.o util.o slackline_emacs.o
$(CC) -o $@ lchat.o slackline.o slackline_emacs.o util.o $(LIBS)
lchat.o: lchat.c
$(CC) -c $(CFLAGS) -D_BSD_SOURCE -D_XOPEN_SOURCE -D_GNU_SOURCE \
-o $@ lchat.c
filter: filter/indent
filter/indent: filter/indent.c util.o util.h
$(CC) $(CFLAGS) -o $@ filter/indent.c util.o
sl_test.o: sl_test.c slackline.h
$(CC) $(CFLAGS) -Wno-sign-compare -c -o $@ sl_test.c
sl_test: sl_test.o slackline.o slackline_emacs.o slackline.h
$(CC) $(CFLAGS) -o $@ sl_test.o slackline.o slackline_emacs.o $(LIBS)
slackline.o: slackline.c slackline.h
$(CC) -c $(CFLAGS) -o $@ slackline.c
slackline_emacs.o: slackline_emacs.c slackline.h
$(CC) -c $(CFLAGS) -o $@ slackline_emacs.c
util.o: util.c util.h
$(CC) -c $(CFLAGS) -D_BSD_SOURCE -o $@ util.c