ifeq "$(ROOTDIR)" ""
export ROOTDIR=$(shell while true; do if [ -f BaseVar.mk ]; then pwd;exit; else cd ..;fi;done;)
endif

include $(ROOTDIR)/.config
include $(ROOTDIR)/BaseVar.mk
.PHONY: all build clean distclean
SRCDIR=$(CURDIR)/sendip-2.5
all: build


build:
	make -C $(SRCDIR) CC=$(CROSS_COMPILE)gcc all 

clean:
	make -C $(SRCDIR) clean

distclean:
	make -C $(SRCDIR) distclean

install:
	mkdir -p $(FSROOT)/bin
	mkdir -p $(FSROOT)/lib/sendip
	cp -f $(SRCDIR)/sendip  $(FSROOT)/bin/
	cp -f $(SRCDIR)/*.so  $(FSROOT)/lib/sendip
	$(STRIP) $(FSROOT)/bin/sendip
