2022-02-09 00:35:01 +01:00
|
|
|
## Compiler settings
|
|
|
|
CC = cc
|
2022-02-11 00:19:20 +01:00
|
|
|
CFLAGS = -Wall -Werror -g -std=c99
|
2022-02-09 00:35:01 +01:00
|
|
|
LDFLAGS =
|
|
|
|
|
|
|
|
## Project settings
|
|
|
|
TARGET = f8prog ## name of the application
|
|
|
|
|
|
|
|
## Paths
|
|
|
|
SRC = $(wildcard src/*.c)
|
|
|
|
OFILES = $(patsubst src%, build%, $(patsubst src/%.c, build/%.o, $(SRC)))
|
|
|
|
|
|
|
|
|
|
|
|
$(TARGET): ./build $(OFILES)
|
|
|
|
$(CC) $(CFLAGS) $(OFILES) -o $(TARGET) $(LDFLAGS)
|
|
|
|
|
|
|
|
%.o: ../src/%.c
|
|
|
|
$(CC) $(CFLAGS) -c $^ -o $@
|
|
|
|
|
|
|
|
./build:
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OFILES)
|
|
|
|
rm -f $(TARGET)
|
|
|
|
rm -rf ./build
|
|
|
|
|
|
|
|
test: $(TARGET)
|
|
|
|
./$(TARGET)
|
|
|
|
|
|
|
|
options:
|
|
|
|
@echo $(TARGET) build options:
|
|
|
|
@echo "CFLAGS = ${CFLAGS}"
|
|
|
|
@echo "LDFLAGS = ${LDFLAGS}"
|
|
|
|
@echo "CC = ${CC}"
|
|
|
|
|
|
|
|
.PHONY: options clean test
|