-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (37 loc) · 1.25 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ************************************************************************
# @author: Andreas Kaeberlein
# @copyright: Copyright 2022
# @credits: AKAE
#
# @license: BSDv3
# @maintainer: Andreas Kaeberlein
# @email: andreas.kaeberlein@web.de
#
# @file: Makefile
# @date: 2022-12-18
#
# @brief: Build
# ************************************************************************
# select compiler
CC = gcc
# set linker
LINKER = gcc
# set compiler flags
ifeq ($(origin CFLAGS), undefined)
CFLAGS = -c -O -Wall -Wextra -Wconversion -I . -I ../
endif
# linking flags here
ifeq ($(origin LFLAGS), undefined)
LFLAGS = -Wall -Wextra -I. -lm
endif
all: spi_flash_model_test
spi_flash_model_test: spi_flash_model_test.o spi_flash_model.o
$(LINKER) ./test/spi_flash_model_test.o ./test/spi_flash_model.o $(LFLAGS) -o ./test/spi_flash_model_test
spi_flash_model_test.o: ./test/spi_flash_model_test.c
$(CC) $(CFLAGS) ./test/spi_flash_model_test.c -o ./test/spi_flash_model_test.o
spi_flash_model.o: ./spi_flash_model.c
$(CC) $(CFLAGS) ./spi_flash_model.c -o ./test/spi_flash_model.o
ci: ./spi_flash_model.c
$(CC) $(CFLAGS) -Werror ./spi_flash_model.c -o ./test/spi_flash_model.o
clean:
rm -f ./test/*.o ./test/spi_flash_model_test