makefile change
This commit is contained in:
parent
a53de34b3c
commit
9a486ad037
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
lis3dh
|
lis3dh
|
||||||
.vscode/
|
.vscode/
|
||||||
|
*.o
|
21
Makefile
21
Makefile
@ -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)
|
Loading…
Reference in New Issue
Block a user