Hello, I am trying to run a make file but it gives me the following error:
*go.mod: 1: module: not found*
*go 1.15: unknown command*


here is the make file:

OS = $(shell uname -s)
ARCH := x86
BUILD_DIR := build
BUILD_ABS_DIR := $(CURDIR)/$(BUILD_DIR)

export SHELL := /bin/bash -o pipefail

LD := ld
AS := nasm

GOOS := linux
GOARCH := 386
GOPATH := $(CURDIR)/


LDFLAGS := -n -melf_i386 -T linker.ld -static --no-ld-generated-unwind-info
ASFLAGS := -f elf32

all: clean kernel.elf run

kernel.elf: boot.o go.o
@$(LD) $(LDFLAGS) boot.o go.o -o kernel.elf

os.iso: kernel.elf
@cp kernel.elf iso/boot/kernel.elf
@genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 
4 -A os -input-charset utf8 -quiet -boot-info-table -o os.iso iso

run: os.iso
@bochs -f bochsrc.txt -q

go.o:
@mkdir -p $(BUILD_DIR)
@echo "[go] compiling go sources into a standalone .o file"
echo $(GOPATH)
@GOARCH=386 GOOS=linux GOPATH=$(GOPATH) COG_ENABLED=1 go build -n 2>&1 | 
sed \
-e "1s|^|set -e\n|" \
-e "1s|^|export GOOS=linux\n|" \
-e "1s|^|export GOARCH=386\n|" \
-e "1s|^|export CGO_ENABLED=1\n|" \
-e "1s|^|WORK='$(BUILD_ABS_DIR)'\n|" \
-e "1s|^|alias pack='go tool pack'\n|" \
-e "/^mv/d" \
-e "s|-extld|-tmpdir='$(BUILD_ABS_DIR)' -linkmode=external 
-extldflags='-nostdlib' -extld|g" \
| sh 2>&1 | sed -e "s/^/ | /g"

@# build/go.o is a elf32 object file but all go symbols are unexported. Our
@# asm entrypoint code needs to know the address to 'main.main' so we use
@# objcopy to make that symbol exportable
@echo "[objcopy] export 'main.main' symbol in go.o"
@objcopy --globalize-symbol='main.main' $(BUILD_DIR)/go.o go.o

%.o: assembly/%.asm
@$(AS) $(ASFLAGS) $< -o $@

clean:
@rm -rf *.o kernel.elf os.iso iso/boot/kernel.elf build/



Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3671f575-101a-4e7b-8b99-44ae0b1b68c7n%40googlegroups.com.

Reply via email to