From f4a7033d3629976f9980cb956e2c29315c6306c0 Mon Sep 17 00:00:00 2001 From: Robert Gustafsson Date: Tue, 3 Oct 2017 09:14:55 +0200 Subject: Some refactoring --- broccoli/Makefile | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'broccoli/Makefile') 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/* -- cgit v1.2.3