ccc/Makefile

39 lines
848 B
Makefile
Raw Normal View History

2024-03-09 12:43:35 +01:00
.POSIX:
.SUFFIXES:
TARGET = ccc
MANPAGE = ccc.1
SRC = ccc.c util.c file.c
2024-03-09 12:43:35 +01:00
# Flags
LDFLAGS = $(shell pkg-config --libs ncurses)
CFLAGS = -march=native -mtune=native -O3 -pipe -O3 -s -std=c99 -pedantic $(shell pkg-config --cflags ncurses) -Wall # -Wextra -Werror
CC=cc
2024-03-09 12:43:35 +01:00
PREFIX ?= /usr/local
CONF = config.h
2024-03-09 12:43:35 +01:00
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
.PHONY: all install uninstall clean
2024-03-13 20:19:22 +01:00
$(TARGET): $(SRC)
2024-03-09 12:43:35 +01:00
$(CC) $(CFLAGS) $(LDFLAGS) $(SRC) -o $@
2024-03-13 20:19:22 +01:00
all: $(TARGET)
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:
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
$(RM) $(DESTDIR)$(MANDIR)/$(MANPAGE)
clean:
$(RM) $(TARGET)