-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (37 loc) · 1.02 KB
/
Makefile
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
# Project: 68k-emu
TOPDIR = .
include config.mk
# Sub directories to build
SUBDIRS = userspace kernel
.PHONY: all clean rootfs
.PHONY: $(SUBDIRS)
all: $(SUBDIRS)
@dd if=/dev/zero of=bin/sd.img bs=1M count=32
@/sbin/mkfs.msdos bin/sd.img
@cp bin/kernel.elf bin/kernel-debug.elf
@m68k-elf-strip bin/kernel.elf
@mcopy -i bin/sd.img -D o bin/kernel.elf ::/
@echo "Build complete."
@echo
rootfs:
@xxd -i $(OSFS) kernel/root.c
bin:
@echo " [INIT] bin/"
@$(MKDIR) bin/
clean: $(SUBDIRS)
@echo " [ RM ] bin/"
@$(RM) $(BIOS) $(BOOTIMG) $(KERNEL) $(OSFS)
@$(RMDIR) bin/
@echo
@echo "Source tree cleaned."
@echo
kernel: userspace | bin
@echo " [ CD ] $(CURRENTPATH)$@/"
@+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS)
userspace: | bin
@echo " [ CD ] $(CURRENTPATH)$@/"
@+make -C "$@" "CURRENTPATH=$(CURRENTPATH)$@/" $(MAKECMDGOALS)
@echo " [MKFS] $(OSFS)"
@genromfs -f $(OSFS) -d bin/root/ -V TrollOS
@echo " [OCPY] kernel/rootfs.o"
@m68k-elf-objcopy -I binary -O elf32-m68k "$(OSFS)" kernel/rootfs.o