From 168bdf072b7fbd5a27915a65a383cbbf88945d2f Mon Sep 17 00:00:00 2001 From: Mikhail Burakov Date: Sat, 27 Feb 2021 09:28:43 +0100 Subject: Change targets order --- makefile | 19 +++++++++++-------- 1 file 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) -- cgit v1.2.3