vip/Makefile

42 lines
870 B
Makefile
Raw Normal View History

2024-06-22 21:50:38 +02:00
.POSIX:
.SUFFIXES:
CC = cc
VERSION = 1.0
TARGET = vip
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
2024-07-01 04:11:07 +02:00
MANDIR = $(PREFIX)/share/man/man1
2024-06-22 21:50:38 +02:00
# Flags
CFLAGS = -O3 -march=native -mtune=native -pipe -s -flto -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600
2024-06-22 21:50:38 +02:00
2024-07-04 17:59:32 +02:00
SRC = src/*.c config.h
2024-07-01 04:11:07 +02:00
INCLUDE = include
2024-06-22 21:50:38 +02:00
$(TARGET): $(SRC)
2024-07-04 17:59:32 +02:00
$(CC) $(SRC) -o $@ $(CFLAGS) -I$(INCLUDE) -I.
2024-06-22 21:50:38 +02:00
dist:
mkdir -p $(TARGET)-$(VERSION)
cp -R README.md $(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)
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
clean:
$(RM) $(TARGET)
all: $(TARGET)
.PHONY: all dist install uninstall clean