tlc/Makefile

40 lines
792 B
Makefile
Raw Normal View History

2024-10-12 17:19:59 +02:00
.POSIX:
.SUFFIXES:
CC = cc
VERSION = 1.0
TARGET = tlc
MANPAGE = $(TARGET).1
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
# Flags
2024-10-12 23:01:35 +02:00
CFLAGS = -O3 -march=native -mtune=native -pipe -s -std=c99 -flto -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -lm
2024-10-12 17:19:59 +02:00
SRC = $(TARGET).c
$(TARGET): $(SRC)
$(CC) $(SRC) -o $@ $(CFLAGS)
dist:
mkdir -p $(TARGET)-$(VERSION)
cp -R README.md $(TARGET) $(TARGET)-$(VERSION)
tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION)
gzip $(TARGET)-$(VERSION).tar
rm -rf $(TARGET)-$(VERSION)
install: $(TARGET)
mkdir -p $(DESTDIR)$(BINDIR)
cp -p $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
chmod 755 $(DESTDIR)$(BINDIR)/$(TARGET)
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
clean:
$(RM) $(TARGET)
all: $(TARGET)
.PHONY: all dist install uninstall clean