4 PKG_CONFIG ?
= pkg-config
5 CFLAGS ?
= $(shell $(PKG_CONFIG
) --cflags lua
)
6 LDFLAGS ?
= $(shell $(PKG_CONFIG
) --libs lua
)
8 CFLAGS
+= -Wall
-Werror
-Wextra
11 BINDIR ?
= $(PREFIX
)/bin
12 MANDIR ?
= $(PREFIX
)/share
/man
13 INSTALL_CMOD ?
= $(shell $(PKG_CONFIG
) --variable INSTALL_CMOD lua
)
14 INSTALL_LMOD ?
= $(shell $(PKG_CONFIG
) --variable INSTALL_LMOD lua
)
16 CFLAGS
+= -fPIC
-shared
$(shell $(PKG_CONFIG
) --cflags termkey
)
17 LDFLAGS
+= $(shell $(PKG_CONFIG
) --libs termkey
)
22 .PHONY
: all clean install
27 rm termkey.so wrap-termkey.o
30 mkdir
-p
$(DESTDIR
)$(INSTALL_CMOD
)
31 cp termkey.so
$(DESTDIR
)$(INSTALL_CMOD
)
34 $(CC
) -c
$(CFLAGS
) -o
$@
$^
36 termkey.so
: wrap-termkey.o
37 $(CC
) -o
$@
$^
$(LDFLAGS
) -shared
-fPIC