summaryrefslogtreecommitdiff
path: root/broccoli/Makefile
blob: 8e397839d5d4b056b7d568058a9c2e9cb65750cc (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
CC=gcc
LIBCFLAGS =-c -fPIC -DBROCCOLI
CFLAGS =-c -DBROCCOLI
INC =-I/usr/local/include -I/usr/local/include -I./includes
LDFLAGS =  -L/usr/local/lib -lbroccoli -pthread
DEBUG =
SRC = midbropasad.c broevent.c fifoqueue.c
OBJ = $(patsubst %.c, build/%.o, $(SRC))

all: dirs lib/midbropasad

dirs:
	mkdir -p build bin lib

lib/midbropasad: $(OBJ)
	$(CC) -shared $^ -o lib/libmidbropasad.so $(LDFLAGS)

pasad_test:
	$(CC) test/pasad_test.c -I./includes -o bin/pasad_test -L./lib -lmidbropasad

build/%.o: src/%.c
	$(CC) $(LIBCFLAGS) $(DEBUG) $(INC) $< -o $@

bin/tests: build/fifoqueue.o build/tests.o
	$(CC) $^ -o bin/tests $(LDFLAGS)

build/tests.o: test/tests.c
	$(CC) $(CFLAGS) $(INC) $< -o $@

clean:
	rm build/* bin/*