From 504360e484270b0c54a69a49341f3c1693cc61a8 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 26 Jan 2024 21:33:41 -0500 Subject: compiles differently for each machine --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Makefile') 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 + -- cgit v1.2.3