# PROJECT_NAME         Can_test
# MODULE               Makefile
# COMPANY              SOFTING AG Muenchen
# VERSION              1.00
# DATE                 18.03.03

# Makefile for can_test

CFLAGS=-I../../include -g -Wall -DOLD_PARAM

LIB2=../wrapper/libSoftingWrapper.so.1
PRG=cantest


all: $(LIB2) $(PRG)

SRCS=Can_test.c Dynobuf.c Fifo.c Intexmpl.c Statobuf.c kbhit.c

cantest: Can_test.o Dynobuf.o Fifo.o Intexmpl.o Statobuf.o kbhit.o 
	$(CC) -o $@ -lc -lpthread -lm  -L../wrapper -L../can_lib -lSoftingWrapper -lSoftingCan $^

clean:
	rm -f *.o $(PRG) *~ .depend
	$(MAKE) -C ../can_lib clean
	$(MAKE) -C ../wrapper clean

../wrapper/libSoftingWrapper.so.1:
	$(MAKE) -C ../wrapper

../can_lib/libSoftingCan.so.1:
	$(MAKE) -C ../can_lib


.depend: $(SRCS)
	$(CC) -M $(CFLAGS) $^ >$@

# Target clean uses no dependencies
ifeq ($(MAKECMDGOALS), clean)
    NO_DEPEND = 1
endif

# Include dependencies if NO_DEPEND is not defined
ifndef NO_DEPEND
-include .depend
endif

