diff options
author | Robert Gustafsson <robg@student.chalmers.se> | 2017-10-10 14:54:31 +0200 |
---|---|---|
committer | Robert Gustafsson <robg@student.chalmers.se> | 2017-10-10 14:54:31 +0200 |
commit | 89ea70298caff759b719ab0855ad2cd48dfee0ca (patch) | |
tree | 7d7474202c2f8c48e90be3ae15d668e9e936d170 /broccoli/Makefile | |
parent | 76cc060f5c937e352b9c411800df5b6dfd95e50f (diff) | |
download | midbro-89ea70298caff759b719ab0855ad2cd48dfee0ca.tar.gz midbro-89ea70298caff759b719ab0855ad2cd48dfee0ca.tar.bz2 |
Add shared library
Diffstat (limited to 'broccoli/Makefile')
-rw-r--r-- | broccoli/Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/broccoli/Makefile b/broccoli/Makefile index d115d95..a3bc87a 100644 --- a/broccoli/Makefile +++ b/broccoli/Makefile @@ -1,20 +1,24 @@ 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 SRC = midbropasad.c broevent.c fifoqueue.c OBJ = $(patsubst %.c, build/%.o, $(SRC)) -all: dirs bin/midbropasad bin/tests +all: dirs bin/midbropasad dirs: - mkdir -p build bin + mkdir -p build bin lib bin/midbropasad: $(OBJ) - $(CC) $^ -o bin/midbropasad $(LDFLAGS) + $(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) $(CFLAGS) $(INC) $< -o $@ + $(CC) $(LIBCFLAGS) $(INC) $< -o $@ bin/tests: build/fifoqueue.o build/tests.o $(CC) $^ -o bin/tests $(LDFLAGS) |