aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRiley Beckett <rbeckettvt@gmail.com>2025-10-20 17:12:32 -0400
committerRiley Beckett <rbeckettvt@gmail.com>2025-10-20 17:13:25 -0400
commitd39eee7a5e6f66289f91c0519f92203dd1b7469e (patch)
tree448ea0e666eb175a9457a975bad4fd415285e45e /Makefile
parent024cee7e848ff8550a52db0667f26a53c54d5478 (diff)
generate list of executables and cache faster
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 16 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index fcd9772..d5b6a44 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+PREFIX=/usr
BIN=swenu
CC=gcc
OBJDIR=objs
@@ -8,13 +9,13 @@ VPATH=/usr/share/wayland-protocols/staging/cursor-shape/:/usr/share/wayland-prot
WLPROT=cursor-shape-v1.xml tablet-v2.xml wlr-layer-shell-unstable-v1.xml xdg-shell.xml
WLC=$(patsubst %.xml,$(OBJDIR)/%.c, $(WLPROT))
WLH=$(patsubst %.xml,$(OBJDIR)/%.h, $(WLPROT))
-SRC=$(WLC) $(wildcard *.c) $(wildcard glad/*.c)
+SRC=$(WLC) $(filter-out swenu-exes.c , $(wildcard *.c)) $(wildcard glad/*.c)
OBJ=$(patsubst %.c,$(OBJDIR)/%.o, $(notdir $(SRC)))
HDEPS=state.h wayland.h config.h
-.SILENT: $(OBJ) $(WLC) $(WLH) $(BIN) $(OBJDIR) compile_flags
+.SILENT: $(OBJ) $(WLC) $(WLH) $(BIN) $(OBJDIR) compile_flags swenu-exes $(OBJDIR)/swenu-exes.o
-all: $(OBJDIR) $(BIN)
+all: $(OBJDIR) $(BIN) swenu-exes
$(OBJDIR):
[ -d $@ ] || mkdir -p $@
@@ -23,6 +24,10 @@ $(BIN): $(OBJ)
printf " LD %s\n" $@
$(CC) $(LDFLAGS) $^ -o $@
+swenu-exes: $(OBJDIR)/swenu-exes.o
+ printf " LD %s\n" $@
+ $(CC) $(LDFLAGS) $^ -o $@
+
$(OBJDIR)/%.o: %.c %.h $(HDEPS)
printf " CC %s\n" $@
$(CC) $(CFLAGS) -c $< -o $@
@@ -52,14 +57,16 @@ clean:
rm -rf $(BIN) $(OBJDIR)
install: all
- install -m 755 ./$(BIN) $(PREFIX)/usr/bin
- install -m 755 ./swenu-run $(PREFIX)/usr/bin
- install -m 755 ./swenu-path $(PREFIX)/usr/bin
+ install -m 755 ./$(BIN) $(PREFIX)/bin
+ install -m 755 ./swenu-run $(PREFIX)/bin
+ install -m 755 ./swenu-path $(PREFIX)/bin
+ install -m 755 ./swenu-exes $(PREFIX)/bin
uninstall:
- rm -f $(PREFIX)/usr/bin/$(BIN)
- rm -f $(PREFIX)/usr/bin/swenu-run
- rm -f $(PREFIX)/usr/bin/swenu-path
+ rm -f $(PREFIX)/bin/$(BIN)
+ rm -f $(PREFIX)/bin/swenu-run
+ rm -f $(PREFIX)/bin/swenu-path
+ rm -f $(PREFIX)/bin/swenu-exes
run: all
./swenu-run.sh