bob/Makefile

44 lines
983 B
Makefile
Raw Permalink Normal View History

2024-05-19 19:51:24 +02:00
.POSIX:
.SUFFIXES:
VERSION = 1.0
2024-05-21 22:24:01 +02:00
TARGET = bob
2024-05-19 19:51:24 +02:00
MANPAGE = $(TARGET).1
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
2024-10-22 01:59:00 +02:00
LDFLAGS != pkg-config --libs libcurl
CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE
2024-05-19 19:51:24 +02:00
2024-05-21 22:24:01 +02:00
SRC = bob.c
2024-05-19 19:51:24 +02:00
$(TARGET): $(SRC)
2024-05-21 22:24:01 +02:00
$(CC) $(SRC) -o $@ $(CFLAGS) $(LDFLAGS)
2024-05-19 19:51:24 +02:00
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)
uninstall:
2024-10-22 02:03:55 +02:00
rm $(DESTDIR)$(BINDIR)/$(TARGET)
rm $(DESTDIR)$(MANDIR)/$(MANPAGE)
2024-05-19 19:51:24 +02:00
clean:
2024-10-22 02:03:55 +02:00
rm $(TARGET)
2024-05-19 19:51:24 +02:00
all: $(TARGET)
.PHONY: all dist install uninstall clean