CC?=gcc CFLAGS:=-Wall -Werror -Wextra -I. OBJ=build/femtotcp.o \ build/test/test_linux_eventloop.o build/port/posix/linux_tap.o all: build/test-evloop #Static library static: CFLAGS+=-static static: libtcpip.a libtcpip.a: $(OBJ) @ar rcs $@ $^ clean: @rm -rf build @make -C src/test/unit clean # Test asan: build/test-evloop asan:CFLAGS+=-fsanitize=address asan:LDFLAGS+=-static-libasan build/test:CFLAGS+=-g -ggdb -DTEST_MAIN -DETHERNET build/test:LDFLAGS+=-pthread build/test-evloop: $(OBJ) @echo "[LD] $@" @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) build/%.o: src/%.c @mkdir -p `dirname $@` || true @echo "[CC] $<" @$(CC) $(CFLAGS) -c $< -o $@ unit: @make -C src/test/unit @mkdir -p build/test/ @mv src/test/unit/unit build/test .PHONY: clean all static