Makefile don't take username parameter anymore and fix dist

This commit is contained in:
Night Kaly 2024-10-12 22:04:02 +01:00
parent c37e48007e
commit 561d3a681d
Signed by: night0721
GPG key ID: 957D67B8DB7A119B

View file

@ -10,11 +10,10 @@ MANPAGE = $(TARGET).1
PREFIX ?= /usr/local PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1 MANDIR = $(PREFIX)/share/man/man1
username ?= default
# Flags # Flags
LDFLAGS = $(shell pkg-config --libs libsodium libnotify ncurses sqlite3) LDFLAGS = $(shell pkg-config --libs libsodium libnotify ncurses sqlite3)
CFLAGS = -O3 -mtune=native -march=native -pipe -g -std=c99 -Wno-pointer-sign -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 $(shell pkg-config --cflags libsodium libnotify ncurses sqlite3) -lpthread CFLAGS = -O3 -mtune=native -march=native -pipe -s -std=c99 -Wno-pointer-sign -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 $(shell pkg-config --cflags libsodium libnotify ncurses sqlite3) -lpthread
SERVERSRC = src/zmr/*.c SERVERSRC = src/zmr/*.c
CLIENTSRC = src/zen/*.c CLIENTSRC = src/zen/*.c
@ -25,15 +24,15 @@ all: $(SERVER) $(CLIENT)
$(SERVER): $(SERVERSRC) $(LIBSRC) $(SERVER): $(SERVERSRC) $(LIBSRC)
mkdir -p bin mkdir -p bin
$(CC) $(SERVERSRC) $(LIBSRC) $(INCLUDE) -DUSERNAME=\"$(username)\" -o bin/$@ $(CFLAGS) $(LDFLAGS) $(CC) $(SERVERSRC) $(LIBSRC) $(INCLUDE) -o bin/$@ $(CFLAGS) $(LDFLAGS)
$(CLIENT): $(CLIENTSRC) $(LIBSRC) $(CLIENT): $(CLIENTSRC) $(LIBSRC)
mkdir -p bin mkdir -p bin
$(CC) $(CLIENTSRC) $(LIBSRC) $(INCLUDE) -DUSERNAME=\"$(username)\" -o bin/$@-$(username) $(CFLAGS) $(LDFLAGS) $(CC) $(CLIENTSRC) $(LIBSRC) $(INCLUDE) -o bin/$@ $(CFLAGS) $(LDFLAGS)
dist: dist:
mkdir -p $(TARGET)-$(VERSION) mkdir -p $(TARGET)-$(VERSION)
cp -R README.md $(MANPAGE) $(SERVER) $(CLIENT) $(TARGET)-$(VERSION) cp -R README.md $(MANPAGE) bin/$(SERVER) bin/$(CLIENT) $(TARGET)-$(VERSION)
tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION) tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION)
gzip $(TARGET)-$(VERSION).tar gzip $(TARGET)-$(VERSION).tar
rm -rf $(TARGET)-$(VERSION) rm -rf $(TARGET)-$(VERSION)