# Makefile.IDT.mips, Copyright 1999 (c) by G. Fankhauser & C. Jeker, # Swiss Federal Institute of Technology, # Computer Engineering and Networks Laboratory. # # TOPSY -- A Teachable Operating System. # Implementation of a tiny and simple # micro kernel for teaching purposes. # # For further information, please visit http://www.tik.ee.ethz.ch/~topsy # # This software is provided under the terms of the GNU General Public Licence. # A full copy of the GNU GPL is provided in the file COPYING found in the # development root of Topsy. # # # File: $Source: /usr/drwho/vault/cvs/topsy/Topsy/Makefiles/Makefile.IDT.mips,v $ # Author(s): # Affiliation: ETH Zuerich, TIK # Version: $Revision: 1.23 $ # Creation Date: # Last Date of Change: $Date: 2000/04/05 12:04:58 $ by: $Author: gfa $ # # # $Log: Makefile.IDT.mips,v $ # Revision 1.23 2000/04/05 12:04:58 gfa # *** empty log message *** # # Revision 1.22 1999/12/15 15:15:41 gfa # *** empty log message *** # # Revision 1.21 1999/12/14 14:19:33 gfa # *** empty log message *** # # Revision 1.20 1999/12/14 11:27:59 gfa # *** empty log message *** # # Revision 1.19 1999/12/13 21:48:28 ruf # GNU General Public Licence Update # # Revision 1.18 1999/11/01 09:44:36 gfa # *** empty log message *** # # Revision 1.17 1999/10/31 19:01:24 gfa # *** empty log message *** # # Revision 1.16 1999/10/31 14:42:46 jeker # first fixes for SimOS # # Revision 1.15 1999/10/29 08:25:34 jeker # *** empty log message *** # # Revision 1.14 1999/10/28 21:21:55 jeker # hack to get R3k and R4k running # # Revision 1.13 1999/10/27 14:20:05 jeker # fixes in mips asm code # # Revision 1.12 1999/10/27 11:04:49 jeker # fixes R4k R3k port # # Revision 1.11 1999/10/23 19:07:10 jeker # added Makefile.SimOS.mips and did some code cleanup # # Revision 1.10 1999/09/20 09:30:32 gfa # *** empty log message *** # # Revision 1.9 1999/09/17 07:55:01 gfa # new automatic version string # # Revision 1.8 1999/09/13 07:57:05 gfa # added thread id field to device struct # # Revision 1.7 1999/09/11 12:14:51 gfa # precaution for gcc 2.95 # # Revision 1.6 1999/06/19 12:28:28 gfa # change to Boot/arch... # # Revision 1.5 1999/06/12 16:54:35 gfa # linkscript typo... # # Revision 1.4 1999/06/10 15:10:54 jeker # cleaning up # # Revision 1.3 1999/06/10 13:15:42 jeker # cleaning up # # Revision 1.2 1999/06/07 10:42:20 jeker # fixed some errors in Makefile # # Revision 1.1 1999/06/06 20:54:50 jeker # putting everything together for Topsy 2.0 # # # ############################################################################### # machine dependent subdirectories for each module and folder for object files ARCH=mips # make procedures for the outside all: version bootlink kernel user # include default stuff include Makefiles/Makefile.default include Makefiles/Makefile.user # host platform (Filename Platform.ARCH.PLATFORM) include Makefiles/Platform.$(ARCH).std # address of memory layout description after loading # needed by both kernel startup code (which passes the pointer to the # memory manager) and the bootlinker SEGMAP=800FFF00 USERINKERNELAT=80041000 HEXSEGMAP=0x$(SEGMAP) SEGMAPDEFINE=-DSEGMAP=$(HEXSEGMAP) # compiler defines DEBUG=-g CCDEBUG=$(DEBUG) -ggdb CFLAGS=$(MACHINE_CFLAGS) $(CCDEBUG) -Wall INC=$(addprefix -I, $(ALLDIRS)) -I/class/cs/csa/project/os/compiler/gcc-2.95.3/gcc/include #SAP*** DEFS = -DDEBUG_LEVEL=2 #OPTIMIZE = -O2 -fno-strict-aliasing # for gcc 2.95 ... OPTIMIZE = -O2 LDFLAGS = $(DEBUG) # first the kernel architecture depending files by module STFILESARCH=start.S StartMeFirst.c TOFILESARCH=SyscallMsg.S SupportAsm.S Exception.c PrintReg.c MMFILESARCH=MMDirectMapping.c MMError.c tlb.S TMFILESARCH=TMClock.c TMError.c TMHal.c TMHalAsm.S IOFILESARCH=IOHal.c # now the drivers, this is a temporary solution, will be changed in near future IOFILESDRIVERS=FPGA_Comm.c FPGA_Prog/fpga_prog.c FPGA_Prog/fpgadata.c \ Loopback.c intel8254.c SCN2681_DUART.c Ethertap.c # make depending files LINKSCRIPT=link.$(ARCH).scr KERNEL_LINKSCRIPT=Boot/$(ARCH)/$(LINKSCRIPT) USER_LINKSCRIPT=User/$(LINKSCRIPT) ######################### KERNEL STUFF ######################### # this builds the Topsy mips kernel kernel: kernel.ecoff kernel.bin bootlinking: bootlinker kernel.ecoff: $(REALKERNELOBJS) $(KERNEL_LINKSCRIPT) $(LD) $(LDFLAGS) -o kernel.ecoff $(REALKERNELOBJS) \ -T $(KERNEL_LINKSCRIPT) kernel.bin: $(REALKERNELOBJS) $(KERNEL_LINKSCRIPT) $(LD) $(LDFLAGS) --oformat binary -o kernel.bin $(REALKERNELOBJS) \ -T $(KERNEL_LINKSCRIPT) # something special for the TMClock.c file ${OBJ}/$(TM)/$(ARCH)/TMClock.o: $(OBJ)/%.o: %.c $(OBJ) $(CC) $(CFLAGS) $(INC) $(DEFS) $(SEGMAPDEFINE) -c $< -o $@ # user and kernel need to be joined for download bootlink: kernel user bootlinker $(SIZE) -Ax kernel.ecoff > kSize $(SIZE) -Ax user.ecoff > uSize (cd Boot/$(ARCH); \ ./BootLinker ../../kSize ../../uSize ../../user.srec $(SEGMAP) \ $(USERINKERNELAT); \ mv segmap.bin ../.. ) $(OBJCOPY) kernel.ecoff \ --adjust-section-vma=".user"=+0x$(USERINKERNELAT) \ --add-section=".user"=user.bin \ --adjust-section-vma=".segmap"=+0x$(SEGMAP) \ --add-section=".segmap"=segmap.bin \ --target=ecoff-bigmips topsy.ecoff $(OBJCOPY) --target=srec topsy.ecoff topsy.srec # this is the tool which generates the segmap bootlinker: (cd Boot/$(ARCH); $(LCC) -o BootLinker BootLinker.c) # symbols for simulator symbols: $(NM) kernel.ecoff > kernel.symbols $(NM) user.ecoff > user.symbols $(NM) kernel.ecoff > topsy.symbols $(NM) user.ecoff >> topsy.symbols ########################## USER STUFF ########################## # this builds the Topsy user stuff user: user.ecoff user.bin # shell and user targets # (simulator, debugger, and linker need different obj formats) user.bin: $(REALOBJS) $(SYSCALL) $(USER_LINKSCRIPT) $(LD) $(LDFLAGS) -o user.srec $(REALOBJS) $(SYSCALL) \ -T $(USER_LINKSCRIPT) $(LD) $(LDFLAGS) -o user.bin --oformat binary $(REALOBJS) \ $(SYSCALL) -T $(USER_LINKSCRIPT) user.ecoff: $(REALOBJS) $(SYSCALL) $(USER_LINKSCRIPT) $(LD) $(LDFLAGS) -o user.ecoff --oformat ecoff-bigmips \ $(REALOBJS) $(SYSCALL) -T $(USER_LINKSCRIPT) size: find mips.obj -name "*.o" -print | xargs -x $(SIZE) | sort -n -r echo -n "mips kernel: " $(SIZE) -Ax kernel.ecoff