summaryrefslogtreecommitdiffstats
path: root/01_exercise/Makefile
diff options
context:
space:
mode:
authorNiklas Halle <niklas@niklashalle.net>2020-04-28 11:50:23 +0200
committerNiklas Halle <niklas@niklashalle.net>2020-04-28 11:50:23 +0200
commit0cf88f665b00962e9fa93f0d52977c1437d034c9 (patch)
treee1fabd2009cd83d40ea34f5def8c7c8c7844b928 /01_exercise/Makefile
parentb917ccf417c2f6299ce69f87415f54a6a752018a (diff)
downloadbetriebssysteme-0cf88f665b00962e9fa93f0d52977c1437d034c9.tar.gz
betriebssysteme-0cf88f665b00962e9fa93f0d52977c1437d034c9.zip
adapted dir structure to exercise modualities
Diffstat (limited to '01_exercise/Makefile')
-rw-r--r--01_exercise/Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/01_exercise/Makefile b/01_exercise/Makefile
new file mode 100644
index 0000000..4bf8198
--- /dev/null
+++ b/01_exercise/Makefile
@@ -0,0 +1,28 @@
+#!/usr/bin/make
+.SUFFIXES:
+SRC = bootloader.c
+TAR = bootloader.bin
+PCK = lab-1.zip
+
+CFLAGS = -m32 -c -Os -march=i686 -ffreestanding -Wall -Werror
+LFLAGS = -m elf_i386 -static -Tlinker.ld -nostdlib --nmagic
+
+%.o: %.c
+ $(CC) $(CFLAGS) $^ -o $@
+
+%.elf: %.o
+ $(LD) $(LFLAGS) -o $@ $^
+
+%.bin: %.elf
+ objcopy -O binary $^ $@
+
+all: $(TAR)
+
+run: $(TAR)
+ qemu-system-x86_64 -drive format=raw,file=$^
+
+pack:
+ zip $(PCK) Makefile *.c *.h *.s
+
+clean:
+ $(RM) $(RMFILES) $(TAR) $(PCK)