summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-01-26 21:33:41 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-01-26 21:33:41 -0500
commit504360e484270b0c54a69a49341f3c1693cc61a8 (patch)
tree1b74ff4c56578e634113251cb4e7e171b9eb08b8 /Makefile
parent37b838f4558691e16afd3c2d940947186c8bc13c (diff)
compiles differently for each machine
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 5819b1e..8618d5a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,13 +3,23 @@
include config.mk
+# Determine the machine
+MACHINE := $(shell uname -n)
+
+# Set configuration flags based on the machine
+ifeq ($(MACHINE), battlestation)
+ CONFIG_FLAG = -D_HOST_BATTLESTATION
+else
+ CONFIG_FLAG = -D_HOST_DEFAULT
+endif
+
SRC = drw.c dwm.c util.c
OBJ = ${SRC:.c=.o}
all: dwm
.c.o:
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c ${CFLAGS} ${CONFIG_FLAG} $<
${OBJ}: config.h config.mk
@@ -43,3 +53,4 @@ uninstall:
${DESTDIR}${MANPREFIX}/man1/dwm.1
.PHONY: all clean dist install uninstall
+