# Last edit: Wed Mar 08 17:23:27 2000
# By: Yigal Hochberg, DMH Software
# Wed Mar 08 2000: add bcc configuration files information
# Sat Feb 05 2000: use bc5 (used to be bc45) 
# Tue Jan 18 2000: new structure for DMH snmp-agent dos sdk
# Tue Apr 06 1999: add an example of dmhsmic command-line, snagent.exe->snmpd.exe

#
# Embedded TCP/UDP/IP, SNMP Software
# Copyright (c) Yigal Hochberg, DMH Software 1990-2000. All rights reserved.
#

#
# File: makefile (makefile.bcc)
#
# Simple makefile to build a custom demo SNMP-Agent on Windows NT/9x
# platform
#
# This makefile assumes Borland 16bit (BCC) or bcc32 development environment
# on Windows NT/9x or DOS
#

PRODUCT = snmpd.exe

SRCS = usrinit.c ownmib.c
OBJS = $(SRCS:.c=.obj)

# Compiler definitions
#
CC = bcc
TLINK=TLINK
OUT_OBJ	 = o

# Compiler specific flags
#
# compiler configuration files:
# bcc:   turboc.cfg
# bcc32: bcc32.cfg
# cli option: bcc @<configfile> ...
#
M_MODEL  = -mh
#BWLEVEL = -g5 -j1 -w-par -w-bbf -w-rch -w-aus -w-sig
BWLEVEL = -w-par -w-rch
WLEVEL	 = -w
# Explanation:
# -w-par - don't complain about unused param
# -w-bbf - don't complain about bit-field not int
# -w-rch - don't complain about unreachable code
# -w-sig - don't complain about conversion may lose significant digits.
# -gn - "n" is number of warnings before stop compilation
# -A - ansi c
# -in - "n" is identifier name length

CS_FLAGS = -D__STDC $(M_MODEL) $(WLEVEL) $(BWLEVEL)

#
# Include directories
#
CC_DIR     = C:/Devel/bc31/BIN
CC_INCLDIR = C:/Devel/bc31/include
INCL_DIRS = -I../include #-I$(CC_INCLDIR)
CFLAGS = $(INCL_DIRS) $(CS_FLAGS)



# Libraries
#
LIBDIR = u:/verkko/esim/bcclib
LIB    = $(LIBDIR);$(CC_DIR)\lib\\
DPLIBS = $(LIBDIR)/ipstack.lib $(LIBDIR)/agentlib.lib $(LIBDIR)\dos.lib \
	 $(LIBDIR)\epktdrv.lib $(LIBDIR)\util.lib $(LIBDIR)\l2.lib


LIBS = ipstack dos epktdrv snmain util l2 agentlib

#
# Main target
#
all : $(PRODUCT)


#
# SNMP Agent (DOS demo)
#

# Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly.

$(PRODUCT) : $(OBJS) $(DPLIBS)
	@echo Linking $@ objs: $(OBJS)
	tlink /c /C c0h.obj $(OBJS),$@,$(LIBS) ch


	
#
# Utilities

clean :
	del *.obj
	del *.exe
	del *.map

install : $(PRODUCT)
	copy $(PRODUCT) ..\bin

depend :
	makedepe $(INC_DIRS) $(SRCS)

do :; del snmpd.exe
	nmake

#
# Generic rules
#
.SUFFIXES: .mib .cpp .c .sbr .obj


#
# The DMH smic MIB compiler
# Below is the rule to create a ".c" file from a ".mib file by dmhsmic.
# command-line example: "..\bin\dmhsmic -f flow.c -J -G -y flow.mib"
#
MIBC = ..\dosbin\dmhsmic
MIBC_FLAGS = -J -G -y

.mib.c:
	@echo MIB-Compiling $< to $@
	-@copy $*.c $*.bak
	$(MIBC) -f $@ $(MIBC_FLAGS) $<

#
# cc generic rule
#
.c.obj:
	$(CC) $(CS_FLAGS) $(CFLAGS) -c -$(OUT_OBJ)$@ $<

# Local Variables:
# compile-command:"nmake -f makefile.bcc"
# End:

# EOF: makefile
# DO NOT DELETE THIS LINE -- make depend depends on it.

demomib.obj : demomib.c ../include/snmib.h ../include/sndefs.h \
	      ../include/gendefs.h

