Import of the real code

This commit is contained in:
Jonas Widen
2020-04-25 19:55:38 +02:00
parent 35c61ace5e
commit 6f70008a42
6 changed files with 446 additions and 1 deletions

34
Makefile Normal file

@@ -0,0 +1,34 @@
BUILD_DIR = build
CFLAGS += -std=gnu99 -W -Wall -pedantic
CFLAGS += -Wstrict-prototypes -Wundef -Werror
CFLAGS += -ffunction-sections
CFLAGS += -Os -g
CFLAGS += -DNEXA_PIN=29
LDFLAGS += -lwiringPi
srcs += main.c
srcs += nexa_new.c
objs = $(srcs:%.c=${BUILD_DIR}/%.o)
target = nexa
${BUILD_DIR}/%.o: %.c
@echo "[CC] $< -> $@"
@$(CC) -c $(CFLAGS) -o $@ $<
$(target): $(BUILD_DIR) $(objs)
@echo "[LINK] $@"
@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs)
${BUILD_DIR}:
@mkdir -p $@
clean:
@rm -rf $(objs) $(asm_objs) $(target) $(target.elf) ${BUILD_DIR}
.PHONY: clean
-include $(srcs:%.c=%.d)