ifeq ($(SWARMHOME),)
SWARMHOME=../swarm-2.0
endif
LIBNAME=neuro
APPVERSION=2.0
BUGADDRESS=jmerelo@kal-el.ugr.es
OBJECTS= CompLearning.o SOM.o SOMplus.o Hebb.o Hebb2Layer.o BaseCompLrn.o CRNN.o BaseSingleLayer.o neuron.o
HEADERS=neuro.h  CompLearning.h SOM.h SOMplus.h Hebb.h Hebb2Layer.h BaseCompLrn.h BaseSingleLayer.h CRNN.h neuron.h 
DOCS=neurolib.ps

include $(SWARMHOME)/etc/swarm/Makefile.lib

LIBS = $(shell . $(SWARMHOME)/etc/swarm/config.swarm ; echo $$SWARM_LDADD)
LDFLAGS = $(shell . $(SWARMHOME)/etc/swarm/config.swarm ; echo $$SWARM_LDFLAGS)

LINK = $(bindir)/libtool-swarm --mode link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) 

demo: SOMdemo CRNNdemo

SOMdemo: SOMdemo.o $(OBJECTS)
	$(LINK)

CRNNdemo : CRNNdemo.o  $(OBJECTS)
	$(LINK)

neurodemo: neurodemo.o $(OBJECTS)
	$(LINK)

#Higher level classes
CompLearning.o : CompLearning.m CompLearning.h BaseCompLrn.o
SOM.o: SOM.m SOM.h BaseCompLrn.o
SOMplus.o: SOMplus.m SOMplus.h BaseCompLrn.o
Hebb.o: Hebb.m Hebb.h BaseSingleLayer.o
Hebb2Layer.o: Hebb2Layer.m Hebb2Layer.h neuron.h Makefile
CRNN.o: CRNN.m CRNN.h neuron.o

#Lower level -- abstract classes
BaseCompLrn.o : BaseCompLrn.m BaseCompLrn.h BaseSingleLayer.o
BaseSingleLayer.o: BaseSingleLayer.m BaseSingleLayer.h neuron.o Makefile

#other functions
neuron.o: neuron.m neuron.h Makefile
