Adjusted Makefile to build a shared library
This commit is contained in:
parent
bb00cd64b1
commit
6574198993
9
Makefile
9
Makefile
|
@ -3,14 +3,19 @@ CFLAGS?=
|
||||||
|
|
||||||
CFLAGS_DEBUG=
|
CFLAGS_DEBUG=
|
||||||
|
|
||||||
|
SONAME=libtermkey.so.0
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS_DEBUG=-ggdb -DDEBUG
|
CFLAGS_DEBUG=-ggdb -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: demo
|
all: demo
|
||||||
|
|
||||||
demo: termkey.o driver-csi.o driver-ti.o demo.c
|
demo: libtermkey.so demo.c
|
||||||
$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $^ -lncurses
|
$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $^
|
||||||
|
|
||||||
|
libtermkey.so: termkey.o driver-csi.o driver-ti.o
|
||||||
|
$(LD) -shared -soname=$(SONAME) -o $@ $^ -lncurses
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -Wall -std=c99 -o $@ -c $^
|
$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -Wall -std=c99 -o $@ -c $^
|
||||||
|
|
Loading…
Reference in New Issue