diff options
author | Robert Gustafsson <robg@student.chalmers.se> | 2017-10-03 09:14:55 +0200 |
---|---|---|
committer | Robert Gustafsson <robg@student.chalmers.se> | 2017-10-03 09:14:55 +0200 |
commit | cd393a04244181e73599b24ac38e70778501c120 (patch) | |
tree | 214f728b6099d2d45dd69d80ea18183e49dacdc8 /broccoli/Makefile | |
parent | b8e28ed52cec6de9179a5bb6058def0efc6fcfa5 (diff) | |
download | midbro-cd393a04244181e73599b24ac38e70778501c120.tar.gz midbro-cd393a04244181e73599b24ac38e70778501c120.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/* |