diff options
author | Robert Gustafsson <robg@student.chalmers.se> | 2017-10-03 09:14:55 +0200 |
---|---|---|
committer | Andreas Lindhé <andreas@lindhe.io> | 2017-10-09 12:14:35 +0200 |
commit | f4a7033d3629976f9980cb956e2c29315c6306c0 (patch) | |
tree | 9ef8d5193944f5b0f5e4f0f404cfcbd99cbeef43 /broccoli/Makefile | |
parent | 1df374c02ae16e364cfa9bfab2aa4e7f8e52005e (diff) | |
download | midbro-f4a7033d3629976f9980cb956e2c29315c6306c0.tar.gz midbro-f4a7033d3629976f9980cb956e2c29315c6306c0.tar.bz2 |
Some refactoring
Diffstat (limited to 'broccoli/Makefile')
-rw-r--r-- | broccoli/Makefile | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/broccoli/Makefile b/broccoli/Makefile index 329c60c..ea5465b 100644 --- a/broccoli/Makefile +++ b/broccoli/Makefile @@ -1,26 +1,23 @@ CC=gcc -CFLAGS = -c -Wall -I/usr/local/include -I/usr/local/include -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: midbropasad tests +all: bin/midbropasad bin/tests -midbropasad: midbropasad.o broevent.o fifoqueue.o - $(CC) midbropasad.o broevent.o fifoqueue.o -o midbropasad $(LDFLAGS) +bin/midbropasad: $(OBJ) + $(CC) $^ -o bin/midbropasad $(LDFLAGS) -tests: tests.o fifoqueue.o - $(CC) tests.o fifoqueue.o -o tests +build/%.o: src/%.c + $(CC) $(CFLAGS) $(INC) $< -o $@ -midbropasad.o: midbropasad.c - $(CC) $(CFLAGS) midbropasad.c +bin/tests: build/fifoqueue.o build/tests.o + $(CC) $^ -o bin/tests $(LDFLAGS) -broevent.o: broevent.c - $(CC) $(CFLAGS) broevent.c - -fifoqueue.o: fifoqueue.c - $(CC) -c -Wall fifoqueue.c - -tests.o: tests.c - $(CC) -c -Wall tests.c +build/tests.o: test/tests.c + $(CC) $(CFLAGS) $(INC) $< -o $@ clean: - rm *.o midbropasad tests + rm build/* bin/* |