makefile change

This commit is contained in:
William Clark 2024-04-25 22:34:17 +01:00
parent a53de34b3c
commit 9a486ad037
3 changed files with 16 additions and 10 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
lis3dh
.vscode/
.vscode/
*.o

View File

@ -1,12 +1,17 @@
CC=gcc
CFLAGS=-O0 -g3 -ggdb -std=c89 -W -Werror -Wall -Wextra -Wpedantic -pedantic-errors -Wformat-signedness -I.
CFLAGS+=-Wlogical-op -Wmissing-declarations -Wswitch-default -Wundef -Wformat=2
LFLAGS=-lm
CFILES=$(wildcard *.c)
BINFILE=lis3dh
OPT=-O2 -std=c89 -Wall -Wextra -W -pedantic
CFLAGS=-I. $(OPT)
CFILES=$(wildcard ./*.c)
OBJECTS=$(patsubst %.c,%.o, $(CFILES))
BINARY=lis3dh
all:
$(CC) $(CFLAGS) $(CFILES) -o $(BINFILE) $(LFLAGS)
all: $(BINARY)
$(BINARY): $(OBJECTS)
$(CC) $^ -o $@
%.o:%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(BINFILE)
@rm -rf $(OBJECTS) $(BINARY)

View File

@ -1,6 +1,6 @@
# LIS3DH
A C89 driver for the 3-axis accelerometer LIS3DH. Supports both I2C and SPI.
A C linux driver for the 3-axis accelerometer LIS3DH. Supports both I2C and SPI.
### Features
> - FIFO