apm/Makefile

46 lines
1 KiB
Makefile
Raw Normal View History

2024-04-08 03:50:36 +02:00
.POSIX:
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
2025-01-16 22:47:09 +01:00
PKG_CONFIG = pkg-config
2024-05-19 17:52:18 +02:00
2025-01-16 22:47:09 +01:00
PKGS = libsodium
LIBS != $(PKG_CONFIG) --libs $(PKGS)
INCS != $(PKG_CONFIG) --cflags $(PKGS)
CFLAGS += -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE $(INCS)
2024-05-19 17:52:18 +02:00
2025-01-16 22:47:09 +01:00
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
2024-05-19 17:52:18 +02:00
2025-01-16 22:47:09 +01:00
$(TARGET): $(TARGET).o
$(CC) -o $@ $(TARGET).o $(LIBS)
2024-05-19 17:52:18 +02:00
dist:
mkdir -p $(TARGET)-$(VERSION)
cp -R README.md $(MANPAGE) $(TARGET) $(TARGET)-$(VERSION)
2025-01-16 22:47:09 +01:00
tar -czf $(TARGET)-$(VERSION).tar.gz $(TARGET)-$(VERSION)
2024-05-19 17:52:18 +02:00
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:
2025-01-16 22:47:09 +01:00
rm -f $(DESTDIR)$(BINDIR)/$(TARGET)
rm -f $(DESTDIR)$(MANDIR)/$(MANPAGE)
2024-04-08 03:50:36 +02:00
clean:
2025-01-16 22:47:09 +01:00
rm -f $(TARGET) *.o
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