| 1 |
CC ?= gcc |
| 2 |
PKGCONFIG = $(shell which pkg-config) |
| 3 |
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0) |
| 4 |
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0) |
| 5 |
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0) |
| 6 |
|
| 7 |
SRC = exampleapp.c exampleappwin.c main.c |
| 8 |
BUILT_SRC = resources.c |
| 9 |
|
| 10 |
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o) |
| 11 |
|
| 12 |
all: exampleapp |
| 13 |
|
| 14 |
resources.c: exampleapp.gresource.xml window.ui |
| 15 |
$(GLIB_COMPILE_RESOURCES) exampleapp.gresource.xml --target=$@ --sourcedir=. --generate-source |
| 16 |
|
| 17 |
%.o: %.c |
| 18 |
$(CC) -c -o $(@F) $(CFLAGS) $< |
| 19 |
|
| 20 |
exampleapp: $(OBJS) |
| 21 |
$(CC) -o $(@F) $(OBJS) $(LIBS) |
| 22 |
|
| 23 |
clean: |
| 24 |
rm -f $(BUILT_SRC) |
| 25 |
rm -f $(OBJS) |
| 26 |
rm -f exampleapp |