blob: 4fc076b7ecec9d8dc1232551e32b0a9046599718 (
plain) (
tree)
|
|
TARGET=quart
PREFIX?=/usr/local
MANUALS=$(PREFIX)/share/man
SRC=*.c
CC=gcc
CFLAGS=-D_GNU_SOURCE -std=c99 -pedantic -lm
REL_FLAGS=-O3
DBG_FLAGS=-Wall -g3
COMPILE=$(CC) -o $(TARGET) $(SRC) $(CFLAGS) -Ilib
make: $(SRC)
$(CC) $(REL_FLAGS) $(CFLAGS) -o $(TARGET) $^
debug: $(SRC)
$(CC) $(DBG_FLAGS) -fsanitize=address $(CFLAGS) -o $(TARGET) $^
noasan: $(SRC)
$(CC) $(DBG_FLAGS) $(CFLAGS) -o $(TARGET) $^
docs:
scdoc < man/quart.1.scd > man/quart.1
scdoc < man/quart.5.scd > man/quart.5
.PHONY: clean
clean:
rm -f *.o
rm -f *.1
rm -f *.5
rm -f $(TARGET)
install: $(TARGET)
@cp -v $(TARGET) $(PREFIX)/bin/$(TARGET)
@cp -v qc $(PREFIX)/bin/qc
@install -v -m644 man/quart.1 $(MANUALS)/man1/quart.1
@install -v -m644 man/quart.5 $(MANUALS)/man5/quart.5
@ln -fs $(MANUALS)/man1/quart.1 $(MANUALS)/man1/qc.1
uninstall:
@rm -v $(PREFIX)/bin/$(TARGET)
@rm -v $(PREFIX)/bin/qc
@rm -v $(MANUALS)/man1/quart.1
@rm -v $(MANUALS)/man5/quart.5
@rm -v $(MANUALS)/man1/qc.1
|