CFLAGS = -O2 --std=gnu99 $(EXTRA_CFLAGS)

#CROSS_COMPILE=arm-openwrt-linux-
CC=$(CROSS_COMPILE)gcc

OBJS = \
	main.o \
	options.o \
	defaults.o \
	zones.o \
	forwards.o \
	rules.o \
	redirects.o \
	snats.o \
	utils.o \
	ubus.o \
	ipsets.o \
	includes.o \
	iptables.o 

LIBPATH = -L$(STAGING_DIR)/usr/lib
LIBS = -luci -lubox -lubus -lxtables -lm -ldl -lip4tc -lip6tc -liptext -liptext4 -liptext6 -lip6tc

RELEASE ?= temp_build
STICKY ?= no_sticky

.SUFFIXES: .c

%.o: %.c
	$(CC) -g -c $(CFLAGS) -o $@ $<

.PHONY: all clean firewall3

all:
	make clean
	make firewall3

clean:
	rm -f *.o
	rm -f *.so
	rm -f firewall3

firewall3: $(OBJS)
	$(CC) -o $@ $^ $(LIBS) $(LIBPATH)



