summaryrefslogblamecommitdiffstats
path: root/Makefile
blob: 6523cb09b3858e29b37f002b72fb4e3f15429cb1 (plain) (tree)
1
2
            
                  





























                                                                       




                                                                     

          



                                           
TARGET=quart
PREFIX?=/usr/local
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 < quart.1.scd > quart.1
	scdoc < quart.5.scd > quart.5
	ln -fs quart.1 qc.1

.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 -m644 quart.1 $(PREFIX)/share/man1/quart.1
	@install -m644 quart.5 $(PREFIX)/share/man5/quart.5
	@ln -s $(PREFIX)/share/man5/quart.1 $(PREFIX)/share/man5/qc.1

uninstall:
	@rm -v $(PREFIX)/bin/$(TARGET)
	@rm -v $(PREFIX)/share/man1/quart.1
	@rm -v $(PREFIX)/share/man5/quart.5
	@rm -v $(PREFIX)/share/man5/qc.1