summaryrefslogtreecommitdiff
path: root/Makefile
blob: 49edf25762b4fed1c6330db57985984eb31eccbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
libs := libusb-1.0 libpng16 gtk+-3.0
CFLAGS := -O3 -g -Wall \
	-flax-vector-conversions \
	$(shell pkg-config $(libs) --cflags)
CPPFLAGS := -MMD
LDLIBS := $(shell pkg-config $(libs) --libs)
GLIB_COMPILE_RESOURCES = \
	$(shell pkg-config --variable=glib_compile_resources gio-2.0)

SOURCES := \
	cli.c \
	device.c \
	image.c \
	gui_app.c \
	gui_app_window.c \
	gui_resources.c \
	main.c \
	moticam.c \
	options.c \
	usb_source.c \
	utils.c

all: camicro

gui_resources.c: gui_app.gresource.xml window.ui
	$(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=. --generate-source

camicro: $(SOURCES:%.c=%.o)
	$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@

clean:
	rm -f camicro $(SOURCES:%.c=%.o) $(SOURCES:%.c=%.d) gui_resources.c

-include $(SOURCES:%.c=%.d)