summaryrefslogtreecommitdiff
path: root/Makefile
blob: 65c0cfe34baabd1326f1d386bb776e28251e1d4c (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
35
36
37
38
39
40
41
CC = gcc
CFLAGS = -ggdb -std=c99 -pedantic -Wall $(DEFINES) \
	 $(shell pkg-config --cflags gdk-pixbuf-2.0 glib-2.0 gthread-2.0) \
	 -DN_THREADS=$(shell grep -c ^processor /proc/cpuinfo || echo 2)
LDFLAGS = $(LIBS) -lm \
	  $(shell pkg-config --libs gdk-pixbuf-2.0 glib-2.0 gthread-2.0)

PROGS = wimmel wimmel_gl roi capture
OBJS = wimmel.o wimmel_gl.o util.o roi.o capture.o

all: $(PROGS)

wimmel: wimmel.o util.o
wimmel_gl: wimmel_gl.o util.o
roi: roi.o
capture: capture.o

.PHONY: clean all

%:
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+

%.o: %.c %.h
	$(CC) $(CFLAGS) -c -o $@ $<


wimmel_gl:
	$(CC) $(LDFLAGS) `pkg-config --cflags --libs egl glesv2` -o $@ $+ 

roi.o: roi.c
	$(CC) $(CFLAGS) `pkg-config --cflags gtk+-3.0` -c -o $@ $<
roi:
	$(CC) $(LDFLAGS) `pkg-config --libs gtk+-3.0` -o $@ $+

capture.o: capture.c
	$(CC) $(CFLAGS) `pkg-config --cflags gtk+-3.0 opencv` -c -o $@ $<
capture:
	$(CC) $(LDFLAGS) `pkg-config --libs gtk+-3.0 opencv` -o $@ $+

clean:
	rm -f $(PROGS) $(OBJS)