From 70cd658ad0958beecf464d796e6b9f4e7f62dceb Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 10 Feb 2024 01:17:15 +0400 Subject: [PATCH] CI for Windows. --- .github/workflows/build.yml | 6 ++++++ Makefile | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fa8221..e420c20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,4 +29,10 @@ jobs: run: brew install llvm x86_64-elf-binutils x86_64-elf-gcc - name: LLVM build run: make LLVM=on image.bin + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: LLVM build + run: make LLVM=on image.bin diff --git a/Makefile b/Makefile index 18643dd..f0009a9 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ GDB=gdb OBJCOPY=objcopy -UNAME=uname CAT=cat ifeq ($(OS),Windows_NT) - UNAME=ver CAT=type +else + OS=$(shell uname -s) endif -ifeq ($(shell $(UNAME) -s),Darwin) +ifeq ($(OS),Darwin) AS=x86_64-elf-as LD=x86_64-elf-ld CC=x86_64-elf-gcc @@ -23,12 +23,13 @@ CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 & ASMFLAGS = -m32 -ffreestanding -c -g ifeq ($(LLVM),on) -#AS=llvm-as -ifeq ($(shell $(UNAME) -s),Darwin) + +ifeq ($(OS),Darwin) LD=PATH=/usr/local/opt/llvm/bin:$(PATH) ld.lld else LD=ld.lld endif + CC=clang CFLAGS += -target elf-i386 ASMFLAGS = -target elf-i386 -ffreestanding -c -g