You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
826 B

LIB_NAME= diskinfo
SRC= diskinfo.c
PREFIX?= /usr/local
OS!= uname -s
.if ${OS} != "FreeBSD"
.error "This Makefile and module are designed strictly for FreeBSD."
.endif
.if !empty(LUA_VER)
.if ${LUA_VER} == "jit"
LUA_PC= luajit
.else
LUA_PC= lua-${LUA_VER}
.endif
.else
LUA_PC!= pkg-config --list-all | grep -E '^(lua-[0-9]|luajit)' | awk '{print $$1}' | sort -V | tail -n 1
.endif
LUA_CFLAGS!= pkg-config --cflags ${LUA_PC}
LUA_MODDIR!= pkg-config --variable=INSTALL_CMOD ${LUA_PC}
CFLAGS+= -O2 -fPIC -Wall ${LUA_CFLAGS}
LDFLAGS+= -shared -lcam
all: ${LIB_NAME}.so
${LIB_NAME}.so: ${SRC}
${CC} ${CFLAGS} ${LDFLAGS} -o ${LIB_NAME}.so ${SRC}
clean:
rm -f ${LIB_NAME}.so
install: all
mkdir -p ${DESTDIR}${LUA_MODDIR}
install -m 755 ${LIB_NAME}.so ${DESTDIR}${LUA_MODDIR}/${LIB_NAME}.so
.PHONY: all clean install