libflint/Makefile

43 lines
781 B
Makefile

.PHONY : clean tests all manual
CFLAGS = -std=c99 -Iinclude -pedantic
WARNINGS= -Wall -Wextra
LDFLAGS = -fPIC -shared
TARGET = libflint.so
SRC != ls src/*.c
OBJ = $(SRC:./src/$.c=./obj/%.o)
PREFIX = $(DESTDIR)/usr/local
LIBDIR = $(PREFIX)/lib
all: $(TARGET)
./clanggen.sh
$(TARGET): $(OBJ)
cc $(CFLAGS) $(WARNINGS) $(LDFLAGS) -o $(TARGET) $(OBJ)
./obj/%.o: ./src/%.c
cc $(CFLAGS) -c $< -o $@
install: $(TARGET)
cp $(TARGET) $(LIBDIR)
uninstall:
rm -f $(LIBDIR)/$(TARGET)
clean:
rm -f $(TARGET)
rm -f testrunner
rm -f tcptest
rm -f netmanual
rm -f compile_commands.json
tests:
cc $(CFLAGS) -o testrunner tests/tests.c src/*.c
cc $(CFLAGS) -o tcptest tests/tcptest.c src/*.c
./run_tests.sh
manual:
cc $(CFLAGS) -o netmanual tests/netmanual.c src/*.c