2024-03-09 12:43:35 +01:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
|
|
|
|
2024-03-15 12:51:58 +01:00
|
|
|
VERSION = 1.0
|
2024-03-09 18:37:04 +01:00
|
|
|
TARGET = ccc
|
2024-05-17 09:45:44 +02:00
|
|
|
MANPAGE = $(TARGET).1
|
2024-03-15 12:51:58 +01:00
|
|
|
CONF = config.h
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
MANDIR = $(PREFIX)/share/man/man1
|
2024-03-09 12:43:35 +01:00
|
|
|
|
2024-11-01 00:19:40 +01:00
|
|
|
LDFLAGS != pkg-config --libs libsixel
|
|
|
|
INCFLAGS != pkg-config --cflags libsixel
|
2024-11-01 10:01:41 +01:00
|
|
|
CFLAGS = -O3 -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
|
|
|
|
2024-03-30 04:39:02 +01:00
|
|
|
SRC = ccc.c util.c file.c icons.c
|
2024-03-09 12:43:35 +01:00
|
|
|
|
2024-03-30 22:00:57 +01:00
|
|
|
$(TARGET): $(SRC) $(CONF)
|
2024-03-27 16:22:24 +01:00
|
|
|
$(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
|