# sdig/Makefile: non-autoconf hack, for now
#

CC	= gcc
CFLAGS	= -O2 -Wall # -g -static
PROGS   = sdig nbname swc

# change this to whatever it takes to make these things link on your system

UCDSNMP_CFLAGS = -lsnmp
OPENSSL_CFLAGS = -L/usr/local/ssl/lib -lcrypto

all: $(PROGS)

sdig: sdig.c common.o snmpget.o 
	$(CC) $(CFLAGS) -o sdig sdig.c common.o snmpget.o $(UCDSNMP_CFLAGS) $(OPENSSL_CFLAGS)

swc: swc.c common.o

clean:
	rm -f $(PROGS) *.o

install: all
	cp sdig /usr/local/bin
	cp nbname /usr/local/bin
	@if ( test -f /etc/sdig.conf ) \
	then \
		echo Not replacing existing file: /etc/sdig.conf; \
	else \
		cp sdig.conf /etc; \
	fi
