ifndef COMPILING_WHOLE_TREE
TOPDIR=$(shell pwd)/../../../../..
endif

include $(TOPDIR)/Rules.make

OBJECTS=main.o dun.o sdp.o lib.o msdun.o 

CFLAGS=-I../include -I../../libs/include -I../../sdp/include/\
 -I$(TOPDIR)/libs/conffile \
 -O2 -fPIC -DVERSION=\"1.1rc2\"

ifneq ($(sort $(filter y,$(CONFIG_SAGEM_LB2) $(CONFIG_GENERATION_SAGEM_MINI))),y)
CFLAGS += -mips32
endif

LDFLAGS=-L $(TOPDIR)/libs -lbluetooth -lsdp \

all : dund

dund : $(OBJECTS)
	$(CC) $(LDFLAGS) -o dund $(OBJECTS) $(TOPDIR)/libs/conffile/libconf.a
	$(STRIP) $@

%.o: %.c
	$(CC) $(CFLAGS) -o $@ -c $<
        
clean :
	rm -f *.o dund
