This repository has been archived by the owner on Dec 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
76 lines (68 loc) · 2.09 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
GCC_PREFIX = /usr
CC_CMD = gcc
LD_CMD = gcc
CC = $(GCC_PREFIX)/bin/$(CC_CMD)
LD = $(GCC_PREFIX)/bin/$(LD_CMD)
EXE_NAME = fw1-loggrabber
OBJ_FILES = thread.o queue.o fw1-cursor.o fw1-loggrabber.o
CFLAGS += -m32 -g -Wall -fpic -DLINUX -DUNIXOS=1 -DDEBUG
SYSTEM_LIBS = -lpthread -lresolv -ldl -lnsl -lelf -lstdc++ -lz
OPSEC_PKG_DIR = OPSEC_SDK/pkg_rel
OPSEC_INC_DIR = $(OPSEC_PKG_DIR)/include
OPSEC_LIB_DIR = $(OPSEC_PKG_DIR)/lib/release.dynamic
OPSEC_LIBS = \
-lopsec \
-lcpprod50 \
-lsicauth \
-lskey \
-lfwsetdb \
-lndb \
-lsic \
-lcp_policy \
-lcpca \
-lckpssl \
-lcpcert \
-lcpcryptutil \
-lEncode \
-lcpprng \
-lProdUtils \
-lcpbcrypt \
-lcpopenssl \
-lAppUtils \
-lComUtils \
-lResolve \
-lEventUtils \
-lDataStruct \
-lOS
INSTALL_DIR = /usr/local/fw1-loggrabber
INSTALL_BIN_DIR=${INSTALL_DIR}/bin
INSTALL_ETC_DIR=${INSTALL_DIR}/etc
INSTALL_LIB_DIR=${INSTALL_DIR}/lib
TEMP_DIR=/tmp
%.o: %.c
$(CC) $(CFLAGS) -I$(OPSEC_INC_DIR) -c -o $@ $*.c
$(EXE_NAME): $(OBJ_FILES)
$(LD) $(CFLAGS) -L$(OPSEC_LIB_DIR) -o $@ $(OBJ_FILES) $(OPSEC_LIBS) $(SYSTEM_LIBS)
install:
@echo
@echo "Installing FW1-Loggrabber to ${INSTALL_DIR}:"
@echo
@install -v -o root -g root -m 755 -d ${INSTALL_BIN_DIR}
@install -v -o root -g root -m 755 -d ${INSTALL_ETC_DIR}
@install -v -o root -g root -m 755 -d ${INSTALL_LIB_DIR}
@install -v -o root -g root -m 755 -p fw1-loggrabber ${INSTALL_BIN_DIR}/fw1-loggrabber
@install -v -o root -g root -m 644 -p fw1-loggrabber.conf ${INSTALL_ETC_DIR}/fw1-loggrabber.conf-sample
@install -v -o root -g root -m 644 -p lea.conf ${INSTALL_ETC_DIR}/lea.conf-sample
@install -v -o root -g root -m 644 -t ${INSTALL_LIB_DIR} ${OPSEC_LIB_DIR}/*.so
@echo
@echo "Installation complete! Please declare the following environment variables in your shell configuration file:"
@echo
@echo " LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:${INSTALL_LIB_DIR}"
@echo " export LD_LIBRARY_PATH"
@echo " LOGGRABBER_CONFIG_PATH=${INSTALL_ETC_DIR}"
@echo " export LOGGRABBER_CONFIG_PATH"
@echo " LOGGRABBER_TEMP_PATH=${TEMP_DIR}"
@echo " export LOGGRABBER_TEMP_PATH"
@echo
clean:
rm -f *.o $(EXE_NAME)