2024-12-07 17:11:43 +00:00
|
|
|
# Compiler settings
|
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -Wall -Wextra -O2
|
|
|
|
PREFIX = /usr/local
|
2024-12-07 19:09:21 +00:00
|
|
|
VERSION = 1.0.1
|
2024-12-07 17:11:43 +00:00
|
|
|
|
|
|
|
# Files
|
|
|
|
PROG = shardz
|
|
|
|
SOURCES = shardz.c
|
|
|
|
OBJECTS = $(SOURCES:.c=.o)
|
|
|
|
|
|
|
|
# Targets
|
|
|
|
all: $(PROG)
|
|
|
|
|
|
|
|
$(PROG): $(OBJECTS)
|
|
|
|
$(CC) $(OBJECTS) $(CFLAGS) -o $(PROG)
|
|
|
|
|
|
|
|
install: $(PROG)
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
|
2024-12-07 19:09:21 +00:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/lib/pkgconfig
|
|
|
|
install -m 644 shardz.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig/
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/man/man1
|
|
|
|
install -m 644 man/shardz.1 $(DESTDIR)$(PREFIX)/share/man/man1/
|
2024-12-07 17:11:43 +00:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG)
|
2024-12-07 19:09:21 +00:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/lib/pkgconfig/shardz.pc
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/shardz.1
|
2024-12-07 17:11:43 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(PROG) $(OBJECTS)
|
|
|
|
|
|
|
|
.PHONY: all install uninstall clean
|