-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
41 lines (30 loc) · 1.15 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
#
# Warning: you may need more libraries than are included here on the
# build line. The agent frequently needs various libraries in order
# to compile pieces of it, but is OS dependent and we can't list all
# the combinations here. Instead, look at the libraries that were
# used when linking the snmpd master agent and copy those to this
# file.
#
CC=gcc
TARGETS=example-demon snmpdemoapp asyncapp
NET_SNMP_CONFIG=net-snmp-config
CFLAGS=`$(NET_SNMP_CONFIG) --cflags` -Wall -Wextra -Werror \
-Wno-unused-parameter
BUILDLIBS=`$(NET_SNMP_CONFIG) --libs`
BUILDAGENTLIBS=`$(NET_SNMP_CONFIG) --agent-libs`
# shared library flags (assumes gcc)
DLFLAGS=-fPIC -shared
all: $(TARGETS)
snmpdemoapp: snmpdemoapp.o
$(CC) -o $@ [email protected] $(BUILDLIBS)
asyncapp: asyncapp.o
$(CC) -o $@ [email protected] $(BUILDLIBS)
example-demon: example-demon.o nstAgentSubagentObject.o
$(CC) -o $@ [email protected] nstAgentSubagentObject.o $(BUILDAGENTLIBS)
clean:
rm -f -- *.o $(TARGETS)
nstAgentPluginObject.o: nstAgentPluginObject.c Makefile
$(CC) $(CFLAGS) $(DLFLAGS) -c -o $@ nstAgentPluginObject.c
nstAgentPluginObject.so: nstAgentPluginObject.o Makefile
$(CC) $(CFLAGS) $(DLFLAGS) -o $@ nstAgentPluginObject.o