From a495c47591577c889843b2afefb040ac0ee88a84 Mon Sep 17 00:00:00 2001 From: Lowl3v3l Date: Tue, 10 May 2016 22:30:32 +0200 Subject: [PATCH] added a Makefile that lacks a solid avrdude-command, added dependency files to gitignore --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..43f7f4f --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +SRC:=$(shell find src -regex '.*\.c') +OBJ:=$(patsubst %,%.o,$(SRC)) +DEP:=$(patsubst %,%.d,$(SRC)) + +CC?=avr-gcc + +CFLAGS?= -O2 -ggdb -std=gnu11 -fomit-frame-pointer -fmerge-all-constants\ +-faggressive-loop-optimizations -finline-functions -funsafe-loop-optimizations\ +-ffreestanding -Wlogical-op -Wdouble-promotion -Wformat -Winit-self -Wnormalized\ +-Wmissing-include-dirs -Wswitch-default -Wpadded -Wswitch-enum -Wall\ +-Wunused -Winline -Wuninitialized -Wstrict-overflow -Wpointer-sign\ +-Wfloat-equal -Wstack-protector -Wtraditional-conversion -Wundef -Wvla\ +-Wdeclaration-after-statement -Wshadow -Wcast-align -Wpedantic -Wextra\ +-Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wtrampolines -Wpacked\ +-Wconversion -Wdate-time -Waggregate-return -Wstrict-prototypes\ +-Wold-style-definition -Wmissing-prototypes -Wvector-operation-performance\ +-Wredundant-decls -Wnested-externs -Wlong-long -Wvariadic-macros\ +-Wdisabled-optimization -Wmissing-declarations -Wunsafe-loop-optimizations\ +-Wunsuffixed-float-constants -pipe -Werror + +ARDUINO?= +PROGRAMMER?= + +.PHONY: all clean check install build + +all: build + +# TODO : find a install commandline +#install: build +# avrdude + +clean: + rm $(OBJ) $(DEP) + +check: + $(CC) $(CFLAGS) -fsyntax-only $(SRC) + +build: $(SRC) + $(CC) $(CFLAGS) $(SRC) -MMD -MP -o hackspace-status.sys + +-include $(sort $(DEP)) \ No newline at end of file