-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile.solaris
138 lines (119 loc) · 3.48 KB
/
Makefile.solaris
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#
# Makefile for opsec applications
#
#
# Change the following variables according
# to your system environment
#
BUILD_HOME=`pwd`
#GCC_PREFIX = /usr/local
GCC_PREFIX = /usr/sfw
CC_CMD = g++
LD_CMD = g++
CC = $(GCC_PREFIX)/bin/$(CC_CMD)
LD = $(GCC_PREFIX)/bin/$(LD_CMD)
PKG_DIR = $(BUILD_HOME)/pkg_rel60_solaris_gcc
#
# set the executable name
#
EXE_NAME = lea_loggrabber
EXE_NAME_DYN =lea_loggrabber_dyn
ARCH = solaris2
COMPILER = gcc
#currently building only the static versions...
#
# define the object (*.o) files that compose the executable
#
OBJ_FILES = $(ARCH)/lea_loggrabber.o
OBJ_FILES_DYN = $(ARCH)/lea_loggrabber_dyn.o
# set 'LIB_DIR' to point to the directory that contains the libraries
# this should be one of: release.static, release.dynamic, debug.static, debug.dynamic
#
LIB_DIR = $(PKG_DIR)/lib/release.static
LIB_DIR_DYN = $(PKG_DIR)/lib/release.dynamic
CPC_DIR =
#
# add cpc++/stdc++ library
#
ifeq ($(ARCH), solaris2)
ifeq ($(COMPILER), gcc)
CPP_DIR =
CPP_LIB = stdc++
else # CC compiler
CPP_DIR =
CPP_LIB =
endif # solaris gcc compiler
endif # solaris2
#
# Static (release or debug) libraries required for link
#
STATIC_LIBS = \
-lopsec \
-lsicauth -lsic \
-lcp_policy \
-lskey \
-lndb \
-lckpssl -lcpcert \
-lcpcryptutil -lcpprng \
-lcpbcrypt -lcpca \
-lasn1cpp \
-lcpopenssl \
-lAppUtils -lEventUtils \
-lEncode -lComUtils \
-lResolve -lDataStruct \
-lOS \
-lcpprod50
#
# Dynamic (release or debug) libraries required for link
#
DYNAMIC_LIBS = \
-lopsec \
-lcpsic -lmessaging \
-lsicauth -lsic \
-lcp_policy \
-lskey \
-lobjlib \
-lCPSrvIS \
-lsicobj -lmastersapi -lfwsmtpobj -lfwadb \
-lndb -lfwsetdb \
-lckpssl -lcpcert \
-lcpcryptutil -lcpprng \
-lcpbcrypt -lcpca \
-lcpopenssl \
-lEncode -lComUtils \
-lResolve -lDataStruct \
-lOS -lAppUtils -lEventUtils -lResolver \
-lcpprod50
#
# set system libraries and CFLAGS
#
ifeq ($(ARCH), solaris2)
LIBS = -lthread -lresolv -lsocket -lnsl -ldl -lintl -lm -lc -lw -lkstat -lkvm -lelf
ifeq ($(COMPILER), gcc)
LIBS += -l$(CPP_LIB)
CFLAGS += -DGCC_COMP -D_REENTRANT -I$(PKG_DIR)/include -Dsolaris2 -DSOLARIS2 -DUNIXOS=1
else # cc compiler
CFLAGS += -xtarget=ultra -xs -g -DDEBUG -Dsolaris2 -DUNIXOS -KPIC -mt -I$(PKG_DIR)/include -xildoff
endif # solaris gcc compiler
else # linux
LIBS = -lpthread -lresolv -ldl -lpam -lnsl -lelf -l$(CPP_LIB)
CFLAGS += -g -fpic -I$(PKG_DIR)/include -Dlinux -DUNIXOS=1 -DDEBUG
endif #solaris2
#
# compilations and link commands
#
$(ARCH)/%.o: %.cpp
mkdir -p $(BUILD_HOME)/solaris2/bin
$(CC) $(CFLAGS) -c -o $(BUILD_HOME)/$@ $*.cpp
$(EXE_NAME): $(OBJ_FILES)
$(LD) $(CFLAGS) -L$(LIB_DIR) -L$(CPC_DIR) -R/usr/local/lib -o $(BUILD_HOME)/solaris2/bin/$@ $(OBJ_FILES) $(STATIC_LIBS) $(LIBS)
clean:
rm -rf $(ARCH)/*.o $(ARCH)/bin/$(EXE_NAME) $(ARCH)/bin/$(EXE_NAME_DYN) lea-loggrabber
install: $(EXE_NAME)
mkdir -p $(BUILD_HOME)/lea-loggrabber/bin $(BUILD_HOME)/lea-loggrabber/default
cp $(BUILD_HOME)/solaris2/bin/$(EXE_NAME) $(BUILD_HOME)/lea-loggrabber/bin
cp $(BUILD_HOME)/opsec-tools/solaris2/opsec.p12 $(BUILD_HOME)/lea-loggrabber/bin
cp $(BUILD_HOME)/opsec-tools/solaris2/sslauthkeys.C $(BUILD_HOME)/lea-loggrabber/bin
cp $(BUILD_HOME)/opsec-tools/solaris2/sslsess.C $(BUILD_HOME)/lea-loggrabber/bin
cp $(BUILD_HOME)/lea-loggrabber.sh $(BUILD_HOME)/lea-loggrabber/bin
cp $(BUILD_HOME)/config/*.conf $(BUILD_HOME)/lea-loggrabber/default