summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 6cecf3eeaa5ff0886d60c7101cc04175752c3299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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