aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 4ca0280aa38f44f912b215b0cbe049a578c74f10 (plain)
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
SHELL = /bin/sh

pkgs = ncursesw glib-2.0 gio-2.0
tests = test-stardict
targets = sdcli $(tests)

CC = clang
CFLAGS = -ggdb -std=gnu99 -Wall -Wextra -Wno-missing-field-initializers \
		 `pkg-config --cflags $(pkgs)`
LDFLAGS = `pkg-config --libs $(pkgs)`

.PHONY: all clean test

all: $(targets)

clean:
	rm -f $(targets) *.o

sdcli: sdcli.o stardict.o
	$(CC) $^ -o $@ $(LDFLAGS)

test-stardict: test-stardict.o stardict.o
	$(CC) $^ -o $@ $(LDFLAGS)

test: $(tests)
	for i in $(tests); do         \
		gtester --verbose ./$$i;  \
	done

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