include $(TOPDIR)/draytek_include/draytek_info

EXEC = nbtscan
OBJS = nbtscan.o statusq.o range.o list.o

#CFLAGS += -Wl,--gc-sections -Werror -fsigned-char -lpthread
CFLAGS += -Wl,--gc-sections -fsigned-char -lpthread
CFLAGS += -I$(TOPDIR)/draytek_include -I$(TOPDIR)/package/draytek
#CFLAGS += -D_DEM

all: $(EXEC)

nbtscan.o: nbtscan.c statusq.h range.h list.h
	$(CC) $(CFLAGS) -c nbtscan.c

statusq.o: statusq.c statusq.h
	$(CC) $(CFLAGS) -c statusq.c

range.o: range.c range.h
	$(CC) $(CFLAGS) -c range.c

list.o: list.c list.h
	$(CC) $(CFLAGS) -c list.c

$(EXEC): $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS)
	$(STRIP) $(EXEC)

clean:
	rm -f $(EXEC) *.o
