-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
154 lines (133 loc) · 4.33 KB
/
Makefile.common
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# This is part of a GNU Makefile, included by the Makefiles in
# each of the subdirectories.
#
# This file includes all of the baseline code provided by Nachos.
# Whenever you add a .h or .cc file, put it in the appropriate
# _H,_C, or _O list.
#
# The dependency graph between assignments is:
# 1. THREADS before everything else
# 2. USERPROG must come before VM
# 3. USERPROG can come before or after FILESYS, but if USERPROG comes
# before (as in this distribution), then it must define FILESYS_STUB
#
# Other than that, you have complete flexibility.
#
# Also whenever you change the include structure of your program, you should
# do a gmake depend in the subdirectory -- this will modify the Makefile
# to keep track of the new dependency.
# You might want to play with the CFLAGS, but if you use -O it may
# break the thread system. You might want to use -fno-inline if
# you need to call some inline functions from the debugger.
# Copyright (c) 1992 The Regents of the University of California.
# All rights reserved. See copyright.h for copyright notice and limitation
# of liability and disclaimer of warranty provisions.
CFLAGS = -g -Wall -Wno-unused-function -Wno-shadow $(INCPATH) $(DEFINES) $(HOST) -DCHANGED
LDFLAGS =
# These definitions may change as the software is updated.
# Some of them are also system dependent
CPP=/lib/cpp
CC = g++
LD = g++
AS = as
PROGRAM = nachos
THREAD_H =../threads/copyright.h\
../threads/list.h\
../threads/priorityqueue.h\
../threads/scheduler.h\
../threads/synch.h \
../threads/synchlist.h\
../threads/system.h\
../threads/thread.h\
../threads/utility.h\
../machine/interrupt.h\
../machine/sysdep.h\
../machine/stats.h\
../machine/timer.h\
../threads/preemptive.h
THREAD_C =../threads/main.cc\
../threads/scheduler.cc\
../threads/synch.cc \
../threads/system.cc\
../threads/thread.cc\
../threads/utility.cc\
../threads/threadtest.cc\
../machine/interrupt.cc\
../machine/sysdep.cc\
../machine/stats.cc\
../machine/timer.cc\
../threads/preemptive.cc
THREAD_S = ../threads/switch.s
THREAD_O =main.o scheduler.o synch.o system.o thread.o \
utility.o threadtest.o interrupt.o stats.o sysdep.o timer.o \
preemptive.o
USERPROG_H = ../userprog/addrspace.h\
../userprog/bitmap.h\
../userprog/exception.h\
../userprog/tables.h\
../userprog/synchconsole.h\
../userprog/copy.h\
../filesys/filesys.h\
../filesys/openfile.h\
../machine/console.h\
../machine/machine.h\
../machine/mipssim.h\
../machine/translate.h
USERPROG_C = ../userprog/addrspace.cc\
../userprog/bitmap.cc\
../userprog/exception.cc\
../userprog/progtest.cc\
../userprog/synchconsole.cc\
../userprog/copy.cc\
../machine/console.cc\
../machine/machine.cc\
../machine/mipssim.cc\
../machine/translate.cc
USERPROG_O = addrspace.o bitmap.o exception.o progtest.o console.o machine.o \
mipssim.o translate.o synchconsole.o copy.o
VM_H = ../vm/swap.h\
../vm/coremap.h\
../vm/replacement.h\
../vm/paging.h
VM_C = ../vm/swap.cc\
../vm/coremap.cc\
../vm/replacement.cc\
../vm/paging.cc
VM_O = swap.o coremap.o replacement.o paging.o
FILESYS_H =../filesys/directory.h \
../filesys/filehdr.h\
../filesys/filesys.h \
../filesys/openfile.h\
../filesys/synchdisk.h\
../machine/disk.h
FILESYS_C =../filesys/directory.cc\
../filesys/filehdr.cc\
../filesys/filesys.cc\
../filesys/fstest.cc\
../filesys/openfile.cc\
../filesys/synchdisk.cc\
../machine/disk.cc
FILESYS_O =directory.o filehdr.o filesys.o fstest.o openfile.o synchdisk.o\
disk.o
NETWORK_H = ../network/post.h ../machine/network.h
NETWORK_C = ../network/nettest.cc ../network/post.cc ../machine/network.cc
NETWORK_O = nettest.o post.o network.o
S_OFILES = switch.o
OFILES = $(C_OFILES) $(S_OFILES)
$(PROGRAM): $(OFILES)
$(LD) $(OFILES) $(LDFLAGS) -o $(PROGRAM)
$(C_OFILES): %.o:
$(CC) $(CFLAGS) -c $<
switch.o: ../threads/switch.s
$(CPP) -x assembler-with-cpp -c -P $(INCPATH) $(HOST) ../threads/switch.s > swtch.s
# $(AS) -o switch.o swtch.s
depend: $(CFILES) $(HFILES)
$(CC) $(INCPATH) $(DEFINES) $(HOST) -DCHANGED -M $(CFILES) > makedep
echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
echo '$$r makedep' >>eddep
echo 'wq' >>eddep
ed - Makefile < eddep
rm eddep makedep
echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
echo '# see make depend above' >> Makefile