# (C) 2001 Szomraky Stefan (stsz@gmx.net)

# change this to no if you don't want compression or don't have the LZO lib
USELZO = yes
# change this if your LZO library is somewhere else
LZOLIB = /usr/local/lib
LZOINC = /usr/local/include

# change this if you want sib to be installed somewhere else
BINPREFIX = /usr/bin

# maybe you want to change this too
GPP = gcc
GPPOPT = -O3 -Wall -rdynamic
DOSTRIP = yes
LIBLNK += -ldl

# end of user configurable section

STDOBJ = config.o ether.o main.o multiplex.o util.o network.o stats.o version.o

ifeq ("$(USELZO)", "yes")
DEFINES += -DHAVE_LZO
LIBLNK += -llzo 
GPP_LI += -L$(LZOLIB) -I$(LZOINC)
endif

GPP := $(GPP) $(GPPOPT) $(DEFINES) $(GPP_LI)

all: sib

clean:
	rm -f *.o sib 

install: all
	install -oroot -groot -m700 sib $(BINPREFIX)/sib

network.o: network.cpp network.h
config.o: config.cpp util.h
ether.o: ether.cpp ether.h
main.o: main.cpp main.h multiplex.h network.h ether.h stats.h
multiplex.o: multiplex.cpp multiplex.h ether.h network.h stats.h
util.o: util.cpp util.h
stats.o: stats.cpp stats.h
version.o: version.cpp version.h

$(STDOBJ): sib.h config.h


sib: $(STDOBJ)
	$(GPP) -o sib $(STDOBJ) $(LIBLNK)
ifeq ("$(DOSTRIP)", "yes")
	strip sib
endif

.cpp.o:
	$(GPP) -c -o $@ $<

.SUFFIXES: .cpp .o

.PHONY: all install clean
