-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (40 loc) · 1.02 KB
/
Copy pathMakefile
File metadata and controls
55 lines (40 loc) · 1.02 KB
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
TOOLSDIR = tools
DRIVE = /dev/sdb
PART = /dev/sdb1
FATFILE = obj/fat
MBRFILE = obj/mbr
##################
# all : compile os
all: checkperms tools build-stages
bin/setmbr $(MBRFILE) $(DRIVE)
bin/setfat $(FATFILE) $(PART)
#######################
# run : run in emulator
run: checkperms
qemu -hda $(DRIVE) -m 32 -cpu 486
######################
# format : format disk
format:
parted $(DRIVE) "mktable msdos"
parted $(DRIVE) "mkpart primary fat32 1 -1"
parted $(DRIVE) "mkfs y 1 fat32"
parted $(DRIVE) "toggle 1 boot"
checkperms:
#################################################
# tools : build the tools needed to compile
tools: setmbr setfat
setmbr:
@make -sC $(TOOLSDIR)/$@
cp $(TOOLSDIR)/$@/out/$@ bin/$@
setfat:
@make -sC $(TOOLSDIR)/$@
cp $(TOOLSDIR)/$@/out/$@ bin/$@
######################################
# build-stages : build the boot stages
build-stages: stage-mbr stage-fat
stage-mbr:
@make -sC stages/mbr
cp stages/mbr/out/mbr $(MBRFILE)
stage-fat:
@make -sC stages/fat
cp stages/fat/out/fat $(FATFILE)