Files
lib11sht/makefile

38 lines
994 B
Makefile
Raw Normal View History

2026-05-23 07:16:28 -03:00
# Copyright (C) 2026 by Prof. Dr. Ruben Carlo Benante
2026-05-23 07:24:05 -03:00
# levenshtein library -- makefile
2026-05-23 07:16:28 -03:00
#
# Usage:
# make build both: cmp11sht (CLI) and test_lib11sht
# make cmp11sht build only the CLI
# make test build + run the stress test suite
# make clean remove built binaries
#
# Uses clang with strict warnings to catch bugs early.
CC = clang
CFLAGS = -std=gnu17 -O2 -g \
-Wall -Wextra -Wpedantic \
-Wshadow -Wpointer-arith -Wcast-qual -Wundef \
-Wstrict-prototypes -Wmissing-prototypes \
-fdiagnostics-color=always
LDLIBS = -lm
LIB_SRC = lib11sht.c
LIB_HDR = lib11sht.h
.PHONY: all test clean
all: cmp11sht test_lib11sht
cmp11sht: cmp11sht.c $(LIB_SRC) $(LIB_HDR)
$(CC) $(CFLAGS) cmp11sht.c $(LIB_SRC) $(LDLIBS) -o $@
test_lib11sht: test_lib11sht.c $(LIB_SRC) $(LIB_HDR)
$(CC) $(CFLAGS) test_lib11sht.c $(LIB_SRC) $(LDLIBS) -o $@
test: test_lib11sht
./test_lib11sht
clean:
rm -f cmp11sht test_lib11sht