aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: b6913f68643844ca81b251adaabdb1555eabd1e3 (plain) (blame)
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
.POSIX:

CONFIGFILE = config.mk
include $(CONFIGFILE)


OBJ =\
	interactive-test.o\
	libterminput.o

HDR =\
	libterminput.h


all: libterminput.a interactive-test
$(OBJ): $(@:.o=.c) $(HDR)

.c.o:
	$(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)

.o.a:
	$(AR) rc $@ $<
	$(AR) -s $@

interactive-test: interactive-test.o libterminput.a
	$(CC) -o $@ interactive-test.o libterminput.a $(LDFLAGS)

install: libterminput.a
	mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
	mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
	cp -- libterminput.a "$(DESTDIR)$(PREFIX)/lib/"
	cp -- libterminput.h "$(DESTDIR)$(PREFIX)/include/"

uninstall:
	rm -- "$(DESTDIR)$(PREFIX)/lib/libterminput.a"
	rm -- "$(DESTDIR)$(PREFIX)/include/libterminput.h"

clean:
	-rm -f -- *.o *.a interactive-test

.SUFFIXES:
.SUFFIXES: .a .o .c

.PHONY: all install uninstall clean