summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorStacy Harper <contact@stacyharper.net>2021-08-22 23:14:47 +0200
committerJohn Sullivan <jsullivan@csumb.edu>2021-10-19 23:12:01 -0700
commit68962909c083c995b4fa44106a34429fc225d29b (patch)
tree6c872c018de3ebbad8d7b75f8f1d73d71e7ce76b /Makefile
parenta7c28e647ece4944dc5cf92cf5dbfddb078919e4 (diff)
downloadsuggpicker-68962909c083c995b4fa44106a34429fc225d29b.tar.gz
Make the layout switchable
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 29beffc..3afd46e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
 include config.mk
 
+NAME=wvkbd
+BIN=${NAME}-${LAYOUT}
 SRC=.
 WLDSRC=wld
 
@@ -8,7 +10,7 @@ PKGS = fontconfig wayland-client xkbcommon pixman-1
 WVKBD_SOURCES += $(wildcard $(SRC)/*.c)
 WVKBD_HEADERS += $(wildcard $(SRC)/*.h)
 
-CFLAGS += -std=gnu99 -Wall -g -DWITH_WAYLAND_SHM
+CFLAGS += -std=gnu99 -Wall -g -DWITH_WAYLAND_SHM -DLAYOUT=\"layout.${LAYOUT}.h\"
 CFLAGS += $(shell pkg-config --cflags $(PKGS))
 LDFLAGS =wld/libwld.a $(shell pkg-config --libs $(PKGS)) -lm -lutil
 
@@ -20,7 +22,7 @@ SOURCES = $(WVKBD_SOURCES) $(WAYLAND_SRC)
 
 OBJECTS = $(SOURCES:.c=.o)
 
-all: wld wvkbd
+all: wld ${BIN}
 
 proto/%-client-protocol.c: proto/%.xml
 	wayland-scanner code < $? > $@
@@ -30,8 +32,8 @@ proto/%-client-protocol.h: proto/%.xml
 
 $(OBJECTS): $(HDRS) $(WVKBD_HEADERS)
 
-wvkbd: $(OBJECTS)
-	$(CC) -o wvkbd $(OBJECTS) $(LDFLAGS)
+wvkbd-${LAYOUT}: $(OBJECTS) layout.${LAYOUT}.h
+	$(CC) -o wvkbd-${LAYOUT} $(OBJECTS) $(LDFLAGS)
 
 wld: wld/libwld.a
 
@@ -39,7 +41,7 @@ wld/libwld.a:
 	$(MAKE) -C wld ENABLE_DRM=0
 
 clean:
-	rm -f $(OBJECTS) $(HDRS) $(WAYLAND_SRC) wvkbd
+	rm -f $(OBJECTS) $(HDRS) $(WAYLAND_SRC) ${BIN}
 	$(MAKE) -C wld clean
 
 format: