From 8b8de8f82de99057d16d0c54b300df19033112c9 Mon Sep 17 00:00:00 2001
From: night0721 <night@night0721.xyz>
Date: Sat, 1 Feb 2025 15:52:37 +0000
Subject: [PATCH] Update makefile

---
 Makefile | 19 +++++++++----------
 ssm.c    |  1 -
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 10e21ac..e3646d2 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
 
diff --git a/ssm.c b/ssm.c
index 85aa84a..434ae9f 100644
--- a/ssm.c
+++ b/ssm.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
 
 #include <stdio.h>
 #include <stdlib.h>