2024-07-01 18:40:47 +02:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
2024-02-06 19:28:28 +01:00
|
|
|
|
2024-07-01 18:40:47 +02:00
|
|
|
CC = cc
|
2024-02-11 02:07:02 +01:00
|
|
|
VERSION = 1.0
|
2024-07-01 18:40:47 +02:00
|
|
|
TARGET = 90s
|
|
|
|
MANPAGE = $(TARGET).1
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
MANDIR = $(PREFIX)/share/man/man1
|
2024-02-06 19:28:28 +01:00
|
|
|
|
2024-07-01 18:40:47 +02:00
|
|
|
# Flags
|
|
|
|
CFLAGS = -O3 -march=native -mtune=native -pipe -s -flto -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DVERSION=$(VERSION)
|
2024-02-06 19:28:28 +01:00
|
|
|
|
2024-07-01 18:40:47 +02:00
|
|
|
SRC = src/*.c
|
|
|
|
INCLUDE = include
|
2024-02-06 19:28:28 +01:00
|
|
|
|
2024-07-01 18:40:47 +02:00
|
|
|
$(TARGET): $(SRC)
|
|
|
|
$(CC) $(SRC) -o $@ $(CFLAGS) -I$(INCLUDE)
|
2024-02-06 19:28:28 +01:00
|
|
|
|
|
|
|
dist:
|
2024-07-01 18:40:47 +02:00
|
|
|
mkdir -p $(TARGET)-$(VERSION)
|
|
|
|
cp -R README.md $(MANPAGE) $(TARGET) $(TARGET)-$(VERSION)
|
|
|
|
tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION)
|
|
|
|
gzip $(TARGET)-$(VERSION).tar
|
|
|
|
rm -rf $(TARGET)-$(VERSION)
|
|
|
|
|
|
|
|
install: $(TARGET)
|
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)
|
|
|
|
cp -p $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
|
|
|
|
chmod 755 $(DESTDIR)$(BINDIR)/$(TARGET)
|
|
|
|
cp -p $(MANPAGE) $(DESTDIR)$(MANDIR)/$(MANPAGE)
|
|
|
|
chmod 644 $(DESTDIR)$(MANDIR)/$(MANPAGE)
|
2024-02-06 19:28:28 +01:00
|
|
|
|
|
|
|
uninstall:
|
2024-07-01 18:40:47 +02:00
|
|
|
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
|
|
|
|
$(RM) $(DESTDIR)$(MANDIR)/$(MANPAGE)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(TARGET)
|
|
|
|
|
|
|
|
all: $(TARGET)
|
2024-02-06 19:28:28 +01:00
|
|
|
|
2024-07-01 18:40:47 +02:00
|
|
|
.PHONY: all dist install uninstall clean
|