forked from garberlog/ARIS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
33 lines (24 loc) · 1.1 KB
/
Makefile
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
CC = gcc # C compiler
LDFLAGS = -shared -lpam
RM = rm -f # rm command
TARGET_LIB = assign-server/src/main/resources/libassign_pam.so # target lib
INC = $(JAVA_HOME)/include $(JAVA_HOME)/include/linux ./include
INC += /usr/lib/jvm/java-8-openjdk-amd64/include /usr/lib/jvm/java-8-openjdk-amd64/include/linux/
INCDIRS = $(INC:%=-I%)
CFLAGS = ${INCDIRS} -Wall -Wextra -fPIC -O2 -g
SRCS = src/assign_pam_auth.c # source files
OBJS = $(SRCS:.c=.o)
.PHONY: all
all: ${TARGET_LIB}
$(TARGET_LIB): $(OBJS) include/edu_rpi_aris_assign_server_auth_PAMLoginAuth.h
$(CC) ${LDFLAGS} -o $@ $(OBJS)
include/edu_rpi_aris_assign_server_auth_PAMLoginAuth.h: gradle
cd assign-server/build/classes/java/main; javah -classpath ../../../../../assign-server/jars/\*:../../../../../assign-server/jars/libs/\* -jni -v -d ../../../../../include edu.rpi.aris.assign.server.auth.PAMLoginAuth
.PHONY: gradle
gradle:
./gradlew build
%.o: %.c include/edu_rpi_aris_assign_server_auth_PAMLoginAuth.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.PHONY: clean
clean:
-${RM} ${TARGET_LIB} ${OBJS} include/edu_rpi_aris_assign_server_auth_PAMLoginAuth.h