|
| 1 | +# This is part of a GNU Makefile, included by the Makefiles in |
| 2 | +# each of the subdirectories. |
| 3 | +# |
| 4 | +# This file includes all of the baseline code provided by Nachos. |
| 5 | +# Whenever you add a .h or .cc file, put it in the appropriate |
| 6 | +# _H,_C, or _O list. |
| 7 | +# |
| 8 | +# The dependency graph between assignments is: |
| 9 | +# 1. THREADS before everything else |
| 10 | +# 2. USERPROG must come before VM |
| 11 | +# 3. USERPROG can come before or after FILESYS, but if USERPROG comes |
| 12 | +# before (as in this distribution), then it must define FILESYS_STUB |
| 13 | +# |
| 14 | +# Other than that, you have complete flexibility. |
| 15 | +# |
| 16 | +# Also whenever you change the include structure of your program, you should |
| 17 | +# do a gmake depend in the subdirectory -- this will modify the Makefile |
| 18 | +# to keep track of the new dependency. |
| 19 | + |
| 20 | +# You might want to play with the CFLAGS, but if you use -O it may |
| 21 | +# break the thread system. You might want to use -fno-inline if |
| 22 | +# you need to call some inline functions from the debugger. |
| 23 | + |
| 24 | +# Copyright (c) 1992 The Regents of the University of California. |
| 25 | +# All rights reserved. See copyright.h for copyright notice and limitation |
| 26 | +# of liability and disclaimer of warranty provisions. |
| 27 | + |
| 28 | +CFLAGS = -g -Wall -Wno-unused -Wshadow -fwritable-strings $(INCPATH) $(DEFINES) $(HOST) -DCHANGED |
| 29 | +LDFLAGS = |
| 30 | + |
| 31 | +# These definitions may change as the software is updated. |
| 32 | +# Some of them are also system dependent |
| 33 | +CPP=/lib/cpp |
| 34 | +CC = /usr/sfw/bin/g++ |
| 35 | +LD = /usr/sfw/bin/g++ |
| 36 | +AS = /usr/ccs/bin/as |
| 37 | + |
| 38 | +PROGRAM = nachos |
| 39 | + |
| 40 | +THREAD_H =../threads/copyright.h\ |
| 41 | + ../threads/list.h\ |
| 42 | + ../threads/scheduler.h\ |
| 43 | + ../threads/synch.h \ |
| 44 | + ../threads/synchlist.h\ |
| 45 | + ../threads/system.h\ |
| 46 | + ../threads/thread.h\ |
| 47 | + ../threads/utility.h\ |
| 48 | + ../machine/interrupt.h\ |
| 49 | + ../machine/sysdep.h\ |
| 50 | + ../machine/stats.h\ |
| 51 | + ../machine/timer.h |
| 52 | + |
| 53 | +THREAD_C =../threads/main.cc\ |
| 54 | + ../threads/list.cc\ |
| 55 | + ../threads/scheduler.cc\ |
| 56 | + ../threads/synch.cc \ |
| 57 | + ../threads/synchlist.cc\ |
| 58 | + ../threads/system.cc\ |
| 59 | + ../threads/thread.cc\ |
| 60 | + ../threads/utility.cc\ |
| 61 | + ../threads/threadtest.cc\ |
| 62 | + ../machine/interrupt.cc\ |
| 63 | + ../machine/sysdep.cc\ |
| 64 | + ../machine/stats.cc\ |
| 65 | + ../machine/timer.cc |
| 66 | + |
| 67 | +THREAD_S = ../threads/switch.s |
| 68 | + |
| 69 | +THREAD_O =main.o list.o scheduler.o synch.o synchlist.o system.o thread.o \ |
| 70 | + utility.o threadtest.o interrupt.o stats.o sysdep.o timer.o |
| 71 | + |
| 72 | +USERPROG_H = ../userprog/addrspace.h\ |
| 73 | + ../userprog/bitmap.h\ |
| 74 | + ../filesys/filesys.h\ |
| 75 | + ../filesys/openfile.h\ |
| 76 | + ../machine/console.h\ |
| 77 | + ../machine/machine.h\ |
| 78 | + ../machine/mipssim.h\ |
| 79 | + ../machine/translate.h |
| 80 | + |
| 81 | +USERPROG_C = ../userprog/addrspace.cc\ |
| 82 | + ../userprog/bitmap.cc\ |
| 83 | + ../userprog/exception.cc\ |
| 84 | + ../userprog/progtest.cc\ |
| 85 | + ../machine/console.cc\ |
| 86 | + ../machine/machine.cc\ |
| 87 | + ../machine/mipssim.cc\ |
| 88 | + ../machine/translate.cc |
| 89 | + |
| 90 | +USERPROG_O = addrspace.o bitmap.o exception.o progtest.o console.o machine.o \ |
| 91 | + mipssim.o translate.o |
| 92 | + |
| 93 | +VM_H = |
| 94 | +VM_C = |
| 95 | +VM_O = |
| 96 | + |
| 97 | +FILESYS_H =../filesys/directory.h \ |
| 98 | + ../filesys/filehdr.h\ |
| 99 | + ../filesys/filesys.h \ |
| 100 | + ../filesys/openfile.h\ |
| 101 | + ../filesys/synchdisk.h\ |
| 102 | + ../machine/disk.h |
| 103 | +FILESYS_C =../filesys/directory.cc\ |
| 104 | + ../filesys/filehdr.cc\ |
| 105 | + ../filesys/filesys.cc\ |
| 106 | + ../filesys/fstest.cc\ |
| 107 | + ../filesys/openfile.cc\ |
| 108 | + ../filesys/synchdisk.cc\ |
| 109 | + ../machine/disk.cc |
| 110 | +FILESYS_O =directory.o filehdr.o filesys.o fstest.o openfile.o synchdisk.o\ |
| 111 | + disk.o |
| 112 | + |
| 113 | +NETWORK_H = ../network/post.h ../machine/network.h |
| 114 | +NETWORK_C = ../network/nettest.cc ../network/post.cc ../machine/network.cc |
| 115 | +NETWORK_O = nettest.o post.o network.o |
| 116 | + |
| 117 | +S_OFILES = switch.o |
| 118 | + |
| 119 | +OFILES = $(C_OFILES) $(S_OFILES) |
| 120 | + |
| 121 | +$(PROGRAM): $(OFILES) |
| 122 | + $(LD) $(OFILES) $(LDFLAGS) -o $(PROGRAM) |
| 123 | + |
| 124 | +$(C_OFILES): %.o: |
| 125 | + $(CC) $(CFLAGS) -c $< |
| 126 | + |
| 127 | +switch.o: ../threads/switch.s |
| 128 | + $(CPP) $(CPP_AS_FLAGS) -P $(INCPATH) $(HOST) ../threads/switch.s > swtch.s |
| 129 | + $(AS) -o switch.o swtch.s |
| 130 | + |
| 131 | +depend: $(CFILES) $(HFILES) |
| 132 | + $(CC) $(INCPATH) $(DEFINES) $(HOST) -DCHANGED -M $(CFILES) > makedep |
| 133 | + echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep |
| 134 | + echo '$$r makedep' >>eddep |
| 135 | + echo 'w' >>eddep |
| 136 | + ed - Makefile < eddep |
| 137 | + rm eddep makedep |
| 138 | + echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile |
| 139 | + echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile |
| 140 | + echo '# see make depend above' >> Makefile |
| 141 | + |
| 142 | +clean:: |
| 143 | + rm -f core nachos DISK *.o swtch.s |
| 144 | + |
0 commit comments