CC=gcc
CCFLAGS= -O2 -Wall
EXTRACCFLAGS= -s -lezV24
DODETECT = dodetect
DODETECTO = dodetect.o detect.o detect.std.o
MKPHN = make_phonedetect.pl
CFILES = detect.std.c dodetect.c
HFILES = detect.std.h detect.h
XFILES = phones.xml Makefile
#VERSION = 0.2.6
PROJNAME = cobex-$(VERSION)

all : $(DODETECT)

$(DODETECT) : $(DODETECTO)
	$(CC) $(CCFLAGS) $(EXTRACCFLAGS) -o $(DODETECT) $(DODETECTO)

dodetect.o : dodetect.c

detect.std.o : detect.std.c detect.std.h

detect.o : detect.c detect.h detect.std.o ../capabilities.h

detect.c : $(MKPHN) phones.xml
	./$(MKPHN)

.c.o:
	$(CC) $(CCFLAGS) -c $<

clean:
	rm -f *.o && rm $(DODETECT)

dist:
	mkdir ../$(PROJNAME)/modeldb
	cp $(XFILES) $(HFILES) $(CFILES) $(MKPHN) ../$(PROJNAME)/modeldb
