aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: ff496cacddd720f8f0a0b996f1290d0a4187cb35 (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
CC?=gcc
CFLAGS?=

CFLAGS_DEBUG=

SONAME=libtermkey.so.0

ifeq ($(DEBUG),1)
  CFLAGS_DEBUG=-ggdb -DDEBUG
endif

all: demo

demo: libtermkey.so demo.c
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $^

libtermkey.so: termkey.o driver-csi.o driver-ti.o
	$(LD) -shared -soname=$(SONAME) -o $@ $^ -lncurses

%.o: %.c
	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -Wall -std=c99 -o $@ -c $^

.PHONY: clean
clean:
	rm -f *.o demo