summary refs log tree commit diff
path: root/bin/edi/Makefile
blob: 2c98d9f25591cdf0699099875e8f8f83a668eeb6 (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
CFLAGS += -Wall -Wextra -Wpedantic
LDLIBS = -lcursesw

OBJS += buffer.o
OBJS += edi.o
OBJS += file.o
OBJS += iter.o
OBJS += log.o
OBJS += table.o

TESTS += buffer.t
TESTS += iter.t
TESTS += table.t

all: tags edi test

tags: *.h *.c
	ctags -w *.h *.c

edi: $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@

$(OBJS): edi.h

test: $(TESTS)
	set -e; $(TESTS:%=./%;)

.SUFFIXES: .t

.c.t:
	$(CC) $(CFLAGS) -DTEST $(LDFLAGS) $< $(LDLIBS) -o $@

clean:
	rm -f tags edi $(OBJS) $(TESTS)