summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: c6fb3236db66668220f049a5b1ed96d181b9f7bf (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
45
46
.POSIX:

CONFIGFILE = config.mk
include $(CONFIGFILE)

OBJ =\
	makel.o\
	makefile.o\
	text.o\
	ui.o\
	util.o

HDR =\
	arg.h\
	common.h

all: makel check
$(OBJ): $(HDR)

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

makel: $(OBJ)
	$(CC) -o $@ $(OBJ) $(LDFLAGS)

check: makel
	./test

install: makel
	mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
	mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/"
	cp -- makel "$(DESTDIR)$(PREFIX)/bin/"
	cp -- makel.1 "$(DESTDIR)$(MANPREFIX)/man1/"

uninstall:
	-rm -f -- "$(DESTDIR)$(PREFIX)/bin/makel"
	-rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/makel.1"

clean:
	-rm -f -- *.o *.a *.su *.gcov *.gcno *.gcda
	-rm -f -- makel

.SUFFIXES:
.SUFFIXES: .o .c

.PHONY: all check install uninstall clean