aboutsummaryrefslogtreecommitdiffstats
path: root/menu/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'menu/Makefile')
-rw-r--r--menu/Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/menu/Makefile b/menu/Makefile
new file mode 100644
index 00000000..4824f05c
--- /dev/null
+++ b/menu/Makefile
@@ -0,0 +1,38 @@
+CC = gcc -funsigned-char -W -Wall
+CFLAGS = -march=i386 -Os
+AS = as
+LD = ld
+OBJCOPY = objcopy
+
+.SUFFIXES: .c .s .s16 .o16 .elf .com
+
+.c.s:
+ $(CC) $(CFLAGS) -S -o $@ $<
+
+.s.s16:
+ echo '.code16gcc' | cat - $< > $@
+
+.s16.o16:
+ $(AS) -o $@ $<
+
+.elf.com:
+ $(OBJCOPY) -O binary $< $@
+
+
+all : menu.com
+
+menu.elf: startup.o16 main.o16 biosio.o16 string.o16 menu.o16 syslinux.o16
+ $(LD) -T com16.ld -o $@ $^
+
+startup.s16: startup.S16
+ $(CC) $(CFLAGS) -x assembler-with-cpp -E -o $@ $<
+
+clean:
+ -rm -f *.s *.s16 *.o16 *.elf *.com
+
+spotless: clean
+ -rm -f *~ \#*
+
+distclean: spotless
+ -rm -f main.c
+