summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6cecf3e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+VERSION = 0.01 pre-alpha
+
+
+KERNEL_FILES = boot/boot.o system/system.o driver/driver.o
+
+SPECIAL_FILES = include/asm/version.h
+
+
+kernel : version WINX
+ @echo
+ @echo WINX $(VERSION) compiled
+ @echo
+
+WINX : Makefile $(KERNEL_FILES)
+ @echo
+ @echo Linking kernel...
+ @ld -Ttext 0x0 -entry start -s --oformat binary -o WINX $(KERNEL_FILES)
+
+floppy : WINX
+ @echo
+ @echo Insert a blank 1.44 Mb floppy into drive 0
+ @echo "Press <Enter> to continue, <^C> to abort..."
+ @read
+ @dd if=WINX of=/dev/fd0 bs=512
+ @echo
+ @echo Done.
+ @echo
+
+clean :
+ @echo
+ @echo Cleanup...
+ @rm -f $(KERNEL_FILES) $(SPECIAL_FILES) $(BOOT_FILES) $(SYSTEM_FILES) $(DRIVER_FILES)
+ @echo OK
+ @echo
+
+
+%.o : %.S
+ @echo Compiling $<
+ @cpp $< -I include | as -o $*.o
+
+%.o : %.c
+ @echo Compiling $<
+ @gcc -I include -c -O3 -fno-zero-initialized-in-bss -o $*.o $<
+
+
+version : include/asm/version.h
+ @if ([ '$(shell cat "include/asm/version.h")' != '#define WINX_VERSION "$(VERSION)"' ]) then \
+ echo "#define WINX_VERSION \"$(VERSION)\"" > include/asm/version.h; fi
+
+include/asm/version.h:
+ @touch "include/asm/version.h"
+
+include boot/Makefile
+include system/Makefile
+include driver/Makefile