#
# $(TOPDIR)/src/snmpsrc/Make.src
#
.SUFFIXES: .c .o

BINARY = snmpsrc

CFILES = snmpsrc.c createreq.c

OFILES = snmpsrc.o createreq.o

#

all: Makefile
	@make $(BINARY)

$(BINARY): $(OFILES)
	@echo "-----"
	$(CC) $(OFILES) -o $(BINARY) $(LDFLAGS) $(LIBDIRS) -l$(SNMP) $(OPTIONAL)

clean:
	-rm -f core *~ *.o $(BINARY)

.c.o:
	@echo "-----"
	$(GENHEADERS) $*.c
	$(CC) $(CFLAGS) $(DEFINES) $(INCDIRS) -c $*.c $(CCERRFILTER)

install: $(BINARY)
	@echo "-----"
	cp $(BINARY) $(BINDIR)/$(BINARY)
	@-if [ $(STRIP) = yes ]; then \
	    strip $(BINDIR)/$(BINARY); \
	fi
	chmod 0755 $(BINDIR)/$(BINARY)

Makefile: ../../Make.defines ./Make.src
	@echo "-----"
	@-if [ -f Makefile ]; then \
	    mv -f Makefile Makefile.bak; \
	fi
	sed -e 's/__TOP__/.\/..\/../' ../../Make.defines > Makefile
	cat ./Make.src >> Makefile
	@make clean
