Init commit
This commit is contained in:
26
example/Makefile
Normal file
26
example/Makefile
Normal file
@ -0,0 +1,26 @@
|
||||
PROGRAM=example
|
||||
OBJS=../syscalls.o ../runtime.go.o colors.go.o colors.gox ../kos.go.o ../kos.gox $(PROGRAM).go.o
|
||||
GOFLAGS=-m32 -c -nostdlib -nostdinc -fno-stack-protector -fno-split-stack -static -fno-leading-underscore -fno-common -fno-pie -I.
|
||||
GO=gccgo
|
||||
ASFLAGS=-g -f elf32 -F dwarf
|
||||
NASM=nasm $(ASFLAGS)
|
||||
OBJCOPY=objcopy
|
||||
LDFLAGS=-n -T ../static.lds -m elf_i386 --no-ld-generated-unwind-info
|
||||
|
||||
all: $(OBJS) link
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(PROGRAM).kex
|
||||
|
||||
link:
|
||||
ld $(LDFLAGS) -o $(PROGRAM).kex $(OBJS)
|
||||
$(OBJCOPY) $(PROGRAM).kex -O binary
|
||||
|
||||
%.gox: %.go.o
|
||||
$(OBJCOPY) -j .go_export $< $@
|
||||
|
||||
%.go.o: %.go
|
||||
$(GO) $(GOFLAGS) -o $@ -c $<
|
||||
|
||||
%.o: %.asm
|
||||
$(NASM) $<
|
Reference in New Issue
Block a user