forked from Telefonica/latch-plugin-openLDAP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (24 loc) · 888 Bytes
/
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
CC := cc
CP := cp
RM := rm
SRCDIR := src
BUILDDIR := build
SRCEXT := c
BUILDEXT := o
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/lib/%,$(SOURCES:.$(SRCEXT)=.$(BUILDEXT)))
CFLAGS := -DPIC -DSLAPD_OVER_LATCH=SLAPD_MOD_DYNAMIC -fPIC -g -O0
LIB := -lcurl -lcrypto -ldl -ljson -lpcre -lssl -pthread -shared
INC := -I${OPENLDAP_DIR}/include -I${OPENLDAP_DIR}/servers/slapd
TARGET := dist/lib/latch-overlay.so
all: ${TARGET}
$(TARGET): $(OBJECTS)
@echo " Linking..."
@mkdir -p dist/lib
@echo " $(CC) $^ -o $(TARGET) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIB)
$(BUILDDIR)/lib/%.$(BUILDEXT): $(SRCDIR)/%.$(SRCEXT)
@mkdir -p $(BUILDDIR)/lib
@echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<" ; $(CC) $(CFLAGS) $(INC) -c -o $@ $<
clean:
@echo " Cleaning...";
@echo " $(RM) -rf $(BUILDDIR) $(TARGET)"; $(RM) -rf $(BUILDDIR) $(TARGET)