From 8e29901fd6064d07dd2024b9be40209c1d1f13b9 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 28 Apr 2026 21:47:52 +0000 Subject: [PATCH] Dateien nach "/" hochladen --- .gitlab-ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ VERSION.txt | 1 + makefile | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 VERSION.txt create mode 100644 makefile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..66c5293 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,38 @@ +stages: + - build + +variables: + F_CPU: "8000000UL" + +before_script: + # nur nötig bei Shell Runner → Tools müssen installiert sein + - avr-gcc --version + +build_dev: + stage: build + tags: + - avr + script: + - VERSION=$(cat VERSION.txt) + - echo "Building version $VERSION" + - make MCU=atmega644pa BUILD_TYPE=dev VERSION=$VERSION + artifacts: + paths: + - build/dev/*.hex + rules: + - if: '$CI_COMMIT_BRANCH == "dev"' + +build_prod: + stage: build + tags: + - avr + script: + - VERSION=$(cat VERSION.txt) + - echo "Building DEV-Version $VERSION" + - make MCU=atmega644pa BUILD_TYPE=prod VERSION=$VERSION + artifacts: + paths: + - build/prod/*.hex + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..ceab6e1 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +0.1 \ No newline at end of file diff --git a/makefile b/makefile new file mode 100644 index 0000000..df525bd --- /dev/null +++ b/makefile @@ -0,0 +1,34 @@ +MCU ?= atmega644pa +BUILD_TYPE ?= dev +VERSION ?= 0.1 + +F_CPU ?= 8000000UL + +CC = avr-gcc +OBJCOPY = avr-objcopy + +SRC = src/main.c + +OUTDIR = build/$(BUILD_TYPE) + +ifeq ($(BUILD_TYPE),dev) + PREFIX = DEV_ENO +else + PREFIX = ENO +endif + +TARGET = $(OUTDIR)/$(PREFIX)_$(VERSION) + +CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -Os -DVERSION=\"$(VERSION)\" + +all: $(TARGET).hex + +$(TARGET).elf: + @mkdir -p $(OUTDIR) + $(CC) $(CFLAGS) $(SRC) -o $@ + +$(TARGET).hex: $(TARGET).elf + $(OBJCOPY) -O ihex -R .eeprom $< $@ + +clean: + rm -rf build \ No newline at end of file