2024-05-16 19:40:44 +02:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
VERSION = 1.0
|
|
|
|
TARGET = slr
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
|
2024-11-05 00:43:37 +01:00
|
|
|
CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE
|
2024-05-16 19:40:44 +02:00
|
|
|
|
2024-05-22 12:12:48 +02:00
|
|
|
SRC = slr.c lexer.c parser.c
|
2024-05-16 19:40:44 +02:00
|
|
|
|
|
|
|
$(TARGET): $(SRC)
|
2024-10-22 02:20:14 +02:00
|
|
|
$(CC) $(SRC) -o $@ $(CFLAGS)
|
2024-05-16 19:40:44 +02:00
|
|
|
|
|
|
|
dist:
|
|
|
|
mkdir -p $(TARGET)-$(VERSION)
|
2024-10-22 02:27:52 +02:00
|
|
|
cp -R README.md $(TARGET) $(TARGET)-$(VERSION)
|
2024-05-16 19:40:44 +02:00
|
|
|
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:
|
2024-10-22 02:20:14 +02:00
|
|
|
rm $(DESTDIR)$(BINDIR)/$(TARGET)
|
2024-05-16 19:40:44 +02:00
|
|
|
|
|
|
|
clean:
|
2024-10-22 02:20:14 +02:00
|
|
|
rm $(TARGET)
|
2024-05-16 19:40:44 +02:00
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
.PHONY: all dist install uninstall clean
|