libflint/Makefile

43 lines
781 B
Makefile
Raw Normal View History

2024-07-08 03:05:32 +00:00
.PHONY : clean tests all manual
2023-10-30 21:22:11 +00:00
2024-07-08 02:50:28 +00:00
CFLAGS = -std=c99 -Iinclude -pedantic
WARNINGS= -Wall -Wextra
2023-10-30 21:22:11 +00:00
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)
2024-07-08 02:50:28 +00:00
./clanggen.sh
2023-10-30 21:22:11 +00:00
$(TARGET): $(OBJ)
2024-07-08 02:50:28 +00:00
cc $(CFLAGS) $(WARNINGS) $(LDFLAGS) -o $(TARGET) $(OBJ)
2023-10-30 21:22:11 +00:00
./obj/%.o: ./src/%.c
cc $(CFLAGS) -c $< -o $@
install: $(TARGET)
cp $(TARGET) $(LIBDIR)
uninstall:
rm -f $(LIBDIR)/$(TARGET)
clean:
rm -f $(TARGET)
2024-07-08 02:50:28 +00:00
rm -f testrunner
rm -f tcptest
2024-07-08 03:05:32 +00:00
rm -f netmanual
2024-07-08 02:50:28 +00:00
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
2023-10-30 21:22:11 +00:00
2024-07-08 03:05:32 +00:00
manual:
cc $(CFLAGS) -o netmanual tests/netmanual.c src/*.c