2024-06-22 21:50:38 +02:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
VERSION = 1.0
|
|
|
|
TARGET = vip
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
|
2024-11-05 01:02:09 +01:00
|
|
|
CFLAGS = -Os -march=native -mtune=native -pipe -s -flto -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE
|
2024-06-22 21:50:38 +02:00
|
|
|
|
2024-10-27 02:46:50 +02:00
|
|
|
SRC != find src -name *.c
|
2024-07-01 04:11:07 +02:00
|
|
|
INCLUDE = include
|
2024-06-22 21:50:38 +02:00
|
|
|
|
2024-10-27 02:46:50 +02:00
|
|
|
$(TARGET): $(SRC) config.h
|
2024-11-05 01:02:09 +01: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)
|
|
|
|
cp -p $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
|
|
|
|
chmod 755 $(DESTDIR)$(BINDIR)/$(TARGET)
|
|
|
|
|
|
|
|
uninstall:
|
2024-10-22 02:29:13 +02:00
|
|
|
rm $(DESTDIR)$(BINDIR)/$(TARGET)
|
2024-06-22 21:50:38 +02:00
|
|
|
|
|
|
|
clean:
|
2024-10-22 02:29:13 +02:00
|
|
|
rm $(TARGET)
|
2024-06-22 21:50:38 +02:00
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
.PHONY: all dist install uninstall clean
|