You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
CC=gcc
|
|
|
|
CFLAGS=-std=c99 -Wall -Wextra
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BIN=./bin
|
|
|
|
SRC=./src
|
|
|
|
INC=./inc
|
|
|
|
TEST=./test
|
|
|
|
EXAMPLE_DIR=./example
|
|
|
|
TESTER_OBJS=$(BIN)/PCircularBuffer.o $(BIN)/test.o
|
|
|
|
EXAMPLE_OBJS=$(BIN)/PCircularBuffer.o $(BIN)/simple_circular_buffer_example.o
|
|
|
|
|
|
|
|
TESTER=$(BIN)/tester
|
|
|
|
EXAMPLE=$(BIN)/simple_circular_buffer_example
|
|
|
|
|
|
|
|
$(TESTER): $(TESTER_OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(TESTER_OBJS)
|
|
|
|
|
|
|
|
$(EXAMPLE): $(EXAMPLE_OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(EXAMPLE_OBJS)
|
|
|
|
|
|
|
|
$(BIN)/PCircularBuffer.o: $(SRC)/PCircularBuffer.c $(INC)/PCircularBuffer.h
|
|
|
|
$(CC) -c $(CFLAGS) -I$(INC) $(SRC)/PCircularBuffer.c -o $(BIN)/PCircularBuffer.o
|
|
|
|
|
|
|
|
$(BIN)/test.o: $(TEST)/test.c
|
|
|
|
$(CC) -c $(CFLAGS) -I$(INC) $(TEST)/test.c -o $(BIN)/test.o
|
|
|
|
|
|
|
|
$(BIN)/simple_circular_buffer_example.o: $(EXAMPLE_DIR)/simple_circular_buffer_example.c
|
|
|
|
$(CC) -c $(CFLAGS) -I$(INC) $(EXAMPLE_DIR)/simple_circular_buffer_example.c -o $(BIN)/simple_circular_buffer_example.o
|
|
|
|
|
|
|
|
all: $(TESTER) $(EXAMPLE)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BIN)/*
|
|
|
|
|
|
|
|
test: $(TESTER)
|
|
|
|
$(TESTER)
|
|
|
|
|
|
|
|
example: $(EXAMPLE)
|
|
|
|
$(EXAMPLE)
|