summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSpencer Williams <spnw@plexwave.org>2025-04-14 14:13:47 -0400
committerSpencer Williams <spnw@plexwave.org>2025-04-14 14:13:47 -0400
commit9f00762307dfe27734a8f451bb6417aaf6a39c07 (patch)
tree950d56921d19ce14176ebef7688a80f80b9b9a67 /Makefile
parentdc121d21632e8b4c40072c2171dbdb655c344836 (diff)
Refactor Makefile to use autodependencies
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 2380dad..866e5a4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,20 @@
TARGET = mpc-bar
CFLAGS = -O2 -fobjc-arc -Wall
LDFLAGS = -lmpdclient -framework Cocoa
+OUTPUT_OPTION=-MMD -MP -o $@
BINDIR = /usr/local/bin
-$(TARGET): mpc-bar.o ini.o
- $(CC) $^ $(LDFLAGS) -o $@
+OBJ=mpc-bar.o ini.o
+DEP=$(OBJ:.o=.d)
-mpc-bar.o ini.o: ini.h
+$(TARGET): $(OBJ)
+ $(CC) $^ $(LDFLAGS) -o $@
install: $(TARGET)
install -d $(BINDIR)
install -m755 $< $(BINDIR)/$<
+-include $(DEP)
+
clean:
- rm -f $(TARGET) mpc-bar.o ini.o
+ rm -f $(TARGET) $(OBJ) $(DEP)