LIBDIR ?= ../lib
ZIPDIR ?= ../..
ZIPPREFIX ?= eduard/hub
ZIPLIST= *.cpp *.h *.tcc Makefile doc/*.html doc/*.fig doc/Makefile
ZIPNAME=hub
ZIPVER=1.3
#
#	derived vars
#
ZIPFILE=$(ZIPNAME)-$(ZIPVER).zip
CXXFLAGS += -fPIC -g -O -MMD -Wall -I.. 
HUB_OBJ=err.o location.o hub.o structural.o behavioral.o named.o pla.o symfunc.o fsm.o
TARGET_LIB= $(LIBDIR)/libeda_hub.so

all: $(TARGET_LIB)

$(TARGET_LIB): $(HUB_OBJ)
	$(CXX) -shared -o $(TARGET_LIB)  $(HUB_OBJ)

clean:
	-@rm *.o
	-@rm *.so
	-@rm *.d
	-@rm *~

depend:
	mv Makefile Makefile.bak
	sed -n 1,/[gG]ENERATED/p Makefile.bak > Makefile
	cat *.d >> Makefile
 
depclean:
	mv Makefile Makefile.bak
	sed -n 1,/[gG]ENERATED/p Makefile.bak > Makefile

archives:
	@cd $(ZIPDIR); \
	if [ -f $(ZIPFILE) ]; then rm $(ZIPFILE); fi; \
	for f in $(ZIPLIST); do \
	find `dirname "$(ZIPPREFIX)/$$f"` -maxdepth 1 -name "`basename "$$f"`" -print | zip $(ZIPFILE) -@;\
	done

# ------------- GENERATED -------------------------
