-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (43 loc) · 1.69 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Name Service Switch module for zookeeper
# Copyright (C) 2016, Intel Corporation.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
INCLUDE_DIR=./include
OBJECT_DIR=./obj
LIBS=-lm
_DEPS=zk_nss.h configuration.h
_OBJ=zk_nss_group.o configuration.o zk.o zk_nss_passwd.o
SO_FILE=libnss_zk.so.2
SO_FILE_LOC=/lib64/$(SO_FILE)
EXE_FILE=zk_nss_test
CC=gcc
CF_FLAGS=-I$(INCLUDE_DIR) $(LIBS) -I/include
DEPS=$(patsubst %,$(INCLUDE_DIR)/%,$(_DEPS))
OBJ=$(patsubst %,$(OBJECT_DIR)/%,$(_OBJ))
$(OBJECT_DIR)/%.o: %.c
$(CC) -c -fPIC -o $@ $< $(CF_FLAGS)
$(SO_FILE): $(OBJ)
$(CC) $(OBJ) -shared -o $(SO_FILE) -l:libzookeeper_mt.so.2 $(CF_FLAGS)
compile: $(SO_FILE)
$(info "Compiled")
$(SO_FILE_LOC): $(SO_FILE)
$(shell cp $(SO_FILE) $(SO_FILE_LOC))
$(EXE_FILE): $(OBJECT_DIR)/$(EXE_FILE).o $(SO_FILE_LOC)
$(CC) $(OBJECT_DIR)/$(EXE_FILE).o -o$(EXE_FILE) -l:$(SO_FILE) -l:libzookeeper_mt.so.2 $(CF_FLAGS)
install: $(SO_FILE_LOC)
$(info "Installed")
clean:
rm -f $(OBJECT_DIR)/*.o *~ core $(INCLUDE_DIR)/*~ $(SO_FILE) $(EXE_FILE)