[POSIX Makefile] The way to incorporate glib-compile-resources
I used to be curios about writing a Makefile IEEE/Open Workforce 1003.1 (POSIX.1) appropriate to combine the `glib-compile-resources` software. I take a `.gresource.xml` record, then collect that to a supply `.c` record to embed GtkBuilder UI into the binary. I used to be pondering of increasing a double suffix regulations:
“`makefile
.POSIX:
.SUFFIXES:
PCCFLAGS = `pkg-config –cflags gtk4`
PCLDFLAGS = `pkg-config –libs gtk4`
all: hi
hi: assets.o hi.o
$(CC) $(CFLAGS) $(PCCFLAGS) $(LDFLAGS) $(PCLDFLAGS) -o $@
assets.o hi.o
assets.o: assets.c
assets.c: assets.gresource.xml
hi.o: hi.c
blank:
@rm -f hi hi.o assets.c assets.o
.SUFFIXES: .c .o .gresource.xml
.c.o:
$(CC) $(CFLAGS) $(PCCFLAGS) -c $<
.gresource.xml.c:
glib-compile-resources –generate-source $<
“`
The theory is that `.gresource.xml.c` double suffix rule will extend and collect to a `.c` record. Despite the fact that there is two dots, I believe it is nonetheless cheap to do since I check in `.gresource.xml` as a unique suffix kind in `.SUFFIXES:`? Or must I’m going about this a special method?
View Reddit by way of astralchan – View Supply