Update makefile

This commit is contained in:
Night Kaly 2025-02-01 15:52:37 +00:00
parent 894ac99171
commit 8b8de8f82d
Signed by: night0721
SSH key fingerprint: SHA256:B/hgVwUoBpx5vdNsXl9w8XwZljA9766uk6T4ubZp5HM
2 changed files with 9 additions and 11 deletions

View file

@ -1,25 +1,24 @@
.POSIX:
.SUFFIXES:
VERSION = 1.0
TARGET = ssm
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
LDFLAGS != pkg-config --libs libnotify
INCFLAGS != pkg-config --cflags libnotify
CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -flto -pedantic -Wall $(INCFLAGS)
CFLAGS += -std=c99 -pedantic -Wall -D_POSIX_C_SOURCE=200809L
SRC = ssm.c
OBJS = $(SRC:.c=.o)
$(TARGET): $(SRC)
$(CC) $(SRC) -o $@ $(CFLAGS) $(LDFLAGS)
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
$(TARGET): $(OBJS)
$(CC) -o $@ $(OBJS)
dist:
mkdir -p $(TARGET)-$(VERSION)
cp -R README.md $(TARGET) $(TARGET)-$(VERSION)
tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION)
gzip $(TARGET)-$(VERSION).tar
tar -czf $(TARGET)-$(VERSION).tar.gz $(TARGET)-$(VERSION)
rm -rf $(TARGET)-$(VERSION)
install: $(TARGET)
@ -28,10 +27,10 @@ install: $(TARGET)
chmod 755 $(DESTDIR)$(BINDIR)/$(TARGET)
uninstall:
rm $(DESTDIR)$(BINDIR)/$(TARGET)
rm -f $(DESTDIR)$(BINDIR)/$(TARGET)
clean:
rm $(TARGET)
rm -f $(TARGET) *.o
all: $(TARGET)

1
ssm.c
View file

@ -1,4 +1,3 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>