-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 728 Bytes
/
Makefile
File metadata and controls
33 lines (23 loc) · 728 Bytes
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
# pam_lua Makefile
# Variables
CC?=cc
BOOTCODE?=src/bootcode.lua
RESULTS= pam_lua.so src/bin2c src/bootcode.h
# The version of Lua we are compiling and linking against. 5.1 for lua5.1, jit for luajit, etc..
lua=5.1
CFLAGS+= -O2 -Isrc `pkg-config --cflags lua${lua}`
LDFLAGS= -lpam `pkg-config --libs lua${lua}`
all: pam_lua.so
# Flag rules
debug: CFLAGS+= -ggdb
debug: pam_lua.so
# Rules
pam_lua.so: src/pam_lua.c src/bootcode.h
${CC} -pedantic -std=c99 -shared -rdynamic -fPIC ${CFLAGS} ${LDFLAGS} -o $@ src/pam_lua.c
src/bin2c: src/bin2c.c
${CC} ${CFLAGS} -Wno-unused-result -o $@ src/bin2c.c
src/bootcode.h: src/bin2c ${BOOTCODE}
src/bin2c ${BOOTCODE} $@ pam_lua_bootcode
# Cleanup
clean:
rm ${RESULTS} || true