ccc/Makefile

45 lines
1.1 KiB
Makefile
Raw Normal View History

2024-03-09 12:43:35 +01:00
.POSIX:
.SUFFIXES:
2024-03-15 12:51:58 +01:00
VERSION = 1.0
TARGET = ccc
2024-05-17 09:45:44 +02:00
MANPAGE = $(TARGET).1
2024-03-15 12:51:58 +01:00
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
2024-03-09 12:43:35 +01:00
2024-11-13 10:44:54 +01:00
LDFLAGS != pkg-config --libs libsixel
INCFLAGS != pkg-config --cflags libsixel
CFLAGS = -Os -march=native -mtune=native -pipe -s -flto -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 $(INCFLAGS)
2024-03-09 12:43:35 +01:00
SRC = ccc.c util.c file.c icons.c
2024-03-09 12:43:35 +01:00
2024-11-12 12:48:32 +01:00
$(TARGET): $(SRC) config.h
$(CC) $(SRC) -o $@ $(CFLAGS) $(LDFLAGS)
2024-03-09 12:43:35 +01:00
2024-03-15 12:51:58 +01: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)
2024-03-09 12:43:35 +01:00
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:13:33 +02:00
rm $(DESTDIR)$(BINDIR)/$(TARGET)
rm $(DESTDIR)$(MANDIR)/$(MANPAGE)
2024-03-09 12:43:35 +01:00
clean:
2024-10-22 02:13:33 +02:00
rm $(TARGET)
2024-03-15 12:51:58 +01:00
all: $(TARGET)
.PHONY: all dist install uninstall clean