apm/Makefile

44 lines
986 B
Makefile
Raw Permalink Normal View History

2024-04-08 03:50:36 +02:00
.POSIX:
.SUFFIXES:
2024-05-19 17:52:18 +02:00
VERSION = 1.0
TARGET = apm
MANPAGE = $(TARGET).1
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
2024-10-22 02:08:43 +02:00
LDFLAGS != pkg-config --libs libsodium
2024-11-05 00:26:02 +01:00
CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE
2024-05-19 17:52:18 +02:00
SRC = apm.c
$(TARGET): $(SRC)
$(CC) $(SRC) -o $@ $(CFLAGS) $(LDFLAGS)
dist:
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-04-08 03:50:36 +02:00
2024-05-19 17:52:18 +02:00
uninstall:
2024-10-22 02:08:43 +02:00
rm $(DESTDIR)$(BINDIR)/$(TARGET)
rm $(DESTDIR)$(MANDIR)/$(MANPAGE)
2024-04-08 03:50:36 +02:00
clean:
2024-10-22 02:08:43 +02:00
rm $(TARGET)
2024-04-08 03:50:36 +02:00
2024-05-19 17:52:18 +02:00
all: $(TARGET)
2024-04-08 03:50:36 +02:00
2024-05-19 17:52:18 +02:00
.PHONY: all dist install uninstall clean