2 # HVF: Hobbyist Virtualization Facility
12 # By default, be terse
15 MAKEFLAGS
+= -rR
--no-print-directory
16 CFLAGS
=-DVERSION
=\"$(VERSION
)\" -g
-fno-strict-aliasing
-fno-builtin
-nostdinc
-nostdlib
-Wall
-m64
-I
include/ -O2
17 NUCLEUSCFLAGS
=-include include/nucleus.h
20 export AS CC LD OBJCOPY
21 export MAKEFLAGS CFLAGS NUCLEUSCFLAGS LDFLAGS
23 TOP_DIRS
=nucleus
/ mm
/ lib
/ drivers
/ cp
/
25 .PHONY
: all build
clean mrproper cleanup hvfclean iplclean
tags
26 .PHONY
: ipl
/ $(TOP_DIRS
)
28 include scripts
/Makefile.commands
31 @echo
"Image is `stat -c %s hvf` bytes"
34 hvf
: $(patsubst %/,%/built-in.o
,$(TOP_DIRS
))
35 $(call link-hvf
,$^
,$@
)
38 @
$(MAKE
) DIR
=nucleus
/ cleanup V
=$V
39 @
$(MAKE
) DIR
=mm
/ cleanup V
=$V
40 @
$(MAKE
) DIR
=lib
/ cleanup V
=$V
41 @
$(MAKE
) DIR
=drivers
/ cleanup V
=$V
42 @
$(MAKE
) DIR
=cp
/ cleanup V
=$V
44 $(call
clean,loader_
*.bin ipl
/*.o ipl
/*.rto ipl
/.
*.o ipl
/ipl_tape.S ipl
/ipl_rdr_ccws.S
)
47 $(call
clean,cscope.out ctags
)
50 $(call
clean,$(DIR
)*.o
)
55 @
$(MAKE
) -f scripts
/Makefile.build DIR
=$@ V
=$V
61 # Include Makefiles from all the top level directories
63 include $(patsubst %/,%/Makefile
,$(TOP_DIRS
))
71 ipl
/: loader_rdr.bin loader_tape.bin
74 loader_rdr.bin
: ipl
/ipl_rdr.rto ipl
/ipl_rdr_ccws.rto ipl
/setmode.rto ipl
/loader_rdr.rto
77 @echo
"Card reader loader is `stat -c %s $@` bytes"
79 loader_tape.bin
: ipl
/ipl_tape.rto ipl
/setmode.rto ipl
/loader_tape.rto
81 @echo
"Tape loader is `stat -c %s $@` bytes"
83 ipl
/loader_asm.o
: ipl
/loader_asm.S
86 ipl
/ipl_tape.S
: ipl
/ipl_tape.S_in ipl
/setmode.rto ipl
/loader_tape.rto scripts
/gen_tape_ipl_s.sh
87 $(call genipl-tape
,ipl
/ipl_tape.S_in
,$@
)
89 ipl
/ipl_rdr_ccws.S
: ipl
/setmode.rto ipl
/loader_rdr.rto
92 ipl
/loader_
%.rto
: ipl
/loader_
%.o
93 $(call objcopy-tdr
,$<,$@
)
95 ipl
/loader_tape.o
: ipl
/loader.c ipl
/loader_asm.o hvf
96 $(call c-to-o-ipl
,ipl
/loader.c
,ipl
/loader_c_tape.o
,4096,`stat -c %s hvf`,-DTAPE_SEEK
)
97 $(call link-ipl
,ipl
/loader_c_tape.o ipl
/loader_asm.o
,$@
)
99 ipl
/loader_rdr.o
: ipl
/loader.c ipl
/loader_asm.o hvf
100 $(call c-to-o-ipl
,ipl
/loader.c
,ipl
/loader_c_rdr.o
,80,`stat -c %s hvf`,)
101 $(call link-ipl
,ipl
/loader_c_rdr.o ipl
/loader_asm.o
,$@
)
104 $(call objcopy-t
,$<,$@
)
107 $(call s-to-o-31
,$<,$@
)