summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile19
1 files changed, 11 insertions, 8 deletions
diff --git a/makefile b/makefile
index 6fd608a..6df170c 100644
--- a/makefile
+++ b/makefile
@@ -1,18 +1,18 @@
-target:=pui
-objects:=\
+lib_objects:=\
font.o \
font_cp00.o \
font_cp04.o \
+ pui.o
+bin_objects:=\
main.o \
- pui.o \
xdg-shell.o
protocols:=/usr/share/wayland-protocols
wl_headers:=xdg-shell.h
-CFLAGS:=-O3 -Wall -Wextra -Werror -pedantic
-LDFLAGS:=-O3 -s -lwayland-client -lrt
+CFLAGS?=-O3 -Wall -Wextra -Werror -pedantic
+LDFLAGS?=-O3 -s -lwayland-client -lrt
-all: $(target) sample.pui
+all: libpui.a pui convert sample.pui
sample.pui: convert sample.bmp sample.ini
./$^ > $@
@@ -20,9 +20,12 @@ sample.pui: convert sample.bmp sample.ini
convert: convert.c
$(CC) $(CFLAGS) -s $< -o $@
-$(target): $(objects)
+pui: $(bin_objects) libpui.a
$(CC) $(LDFLAGS) $^ -o $@
+libpui.a: $(lib_objects)
+ $(AR) rs $@ $^
+
%.o: %.c *.h $(wl_headers)
$(CC) $(CFLAGS) -c $< -o $@
@@ -33,6 +36,6 @@ $(target): $(objects)
wayland-scanner client-header $< $@
clean:
- rm $(target) $(objects) $(wl_headers) convert sample.pui
+ rm pui libpui.a $(bin_objects) $(lib_objects) $(wl_headers) convert sample.pui
.PRECIOUS: $(wl_headers)