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

1
.gitignore vendored
View File

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

View File

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

View File

@ -1,6 +1,6 @@
# LIS3DH # 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 ### Features
> - FIFO > - FIFO