#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#File:    Makefile
#System:  xmib ver. 1.00
#Author:  Ranen Goren
#Date:    26/07/92
#
#File remarks: Makefile for xmib
#
#              . edit paths in this Makefile
#              . choose compiler environment in this Makefile
#              . run 'make'
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


CC         = gcc

# the top directory of Tricklet: you MUST edit this line
TRICKLET   = /CS/stud/ranen/C/ProjSys/Source/tricklet/

# the top directory of Motif: you MUST edit this line
MOTIFDIR   = /net/shuldig/dist/motif/

LIBDIR 	   = /usr/local/lib
INCDIR	   = /usr/local/include
CFLAGS 	   = $(DEBUGFLAGS) $(XCFLAGS) -I$(INCDIR) -I$(TRICKLET)include/ -IInclude/ -DUNIX
LDFLAGS    = -L$(LIBDIR) -L$(TRICKLET)lib/ -lsnmp -lasn1 -lmib -lerr  -lXm -lXt -lX11
XCFLAGS    = -I$(MOTIFDIR)include/
DEBUGFLAGS = -g
BIN	   = xmib


.SILENT:

all: $(BIN)

clean:
	-rm *~ $(BIN) *.o  *.a
	-rm core
	-rm \#*\#


mibParse.o : mibParse.c Include/mibinc.h
	echo Compiling mibParse...	
	$(CC) -IInclude -I$(TRICKLET)include/ -c -o mibParse.o mibParse.c

Tree/Tree.o : Tree/Tree.c
	(cd Tree; $(MAKE))

interface.o: interface.c Include/xmib.h
	echo Compiling interface...
	$(CC) $(CFLAGS) -c -o interface.o interface.c -ITree/

$(BIN): xmib.o interface.o Tree/Tree.o wprintf.o parse.o mibParse.o
	echo Linking...
	$(CC) $(CFLAGS) -o $(BIN)  xmib.o  parse.o \
	interface.o Tree/Tree.o wprintf.o mibParse.o \
	$(LDFLAGS)
