# $Id$
# Kernel Makefile (C) 2002 The UbixOS Project

# Include Global 'Source' Options
include ../Makefile.inc

CC=gcc

#Kernel File Name
BINARY = format

#Objects
OBJS = format.o

# Link the kernel statically with fixed text+data address @1M
$(BINARY) : $(OBJS)
	$(CC)  -o $@ $(OBJS)

# Compile the source files
.cc.o:
	$(CXX)  -Wall -fomit-frame-pointer -O -I../sys/include -c -o $@ $<
 
.cc.s:
	$(CXX)  -Wall -fomit-frame-pointer -O -I../sys/include -S -o $@ $<
 
.c.o:
	$(CC)  -Wall -O -c -o $@ $<
 
.c.s:
	$(CC)  -Wall -fomit-frame-pointer -O -I../sys/include -S -o $@ $<
 
.S.o:
	$(CC)  -Wall -fomit-frame-pointer -c -o $@ $<
 
# Clean up the junk
clean:
	$(REMOVE) $(OBJS) $(BINARY) *.core

format-dsk:
	(cp ../sys/compile/ubix.elf ./)
	(cp ../bin/init/init ./)
	(cp ../bin/login/login ./)
	(cp ../bin/shell/shell ./)
	(cp ../bin/ls/ls ./)
	(cp ../bin/clock/clock ./)
	(cp ../lib/libc/libc.so ./)
	(cp ../bin/fdisk/fdisk ./)
	(cp ../bin/cp/cp ./)
	#(cp ../bin/format/format ./)
	(cp ../sys/boot/mbr/mbr ./)
	(./format 50 2000 /dev/fd0 ubix.elf 0 format 3754 fdisk 3754 ROM8X14.DPF 3754 init 3754 login 3754 shell 3754 userdb 3754 ls 3754 motd 3754 mbr 3754 cp 3754 clock 3754)

	#(./format 263 204361 /dev/md1 ubix.elf 0 format 3754 fdisk 3754 ROM8X14.DPF 3754 init 3754 login 3754 shell 3754 userdb 3754 ls 3754 motd 3754 cp 3754)
	(./format 1064 2000 /dev/fd0 shell 3754 clock 3754)
	#(./format 200 2000 /dev/md1 ubix.elf 0 shell 3754 motd 3754 libc.so 3754)
	(rm -fr ubix.elf)
	(rm -fr login)
	(rm -fr init)
	(rm -fr shell)
	(rm -fr ls)
	(rm -fr clock)
	(rm -fr libc.so)
	(rm -fr cp)
	(rm -fr fdisk)
	#(rm -fr format)
