⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile.common

📁 本次实验的目的在于将nachos中的锁机制和条件变量的实现补充完整
💻 COMMON
字号:
# 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 -Wshadow -fwritable-strings $(INCPATH) $(DEFINES) $(HOST) -DCHANGED 
CFLAGS = -g -Wall -Wshadow -traditional $(INCPATH) $(DEFINES) $(HOST) -DCHANGED 

# These definitions may change as the software is updated.
# Some of them are also system dependent
CPP= gcc -E
CC = g++
LD = g++
AS = as

PROGRAM = nachos

THREAD_H =../threads/copyright.h\
	../threads/list.h\
	../threads/scheduler.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/synch-sem.h\
         ../threads/dllist.h

THREAD_C =../threads/main.cc\
	../threads/list.cc\
	../threads/scheduler.cc\
	../threads/synchlist.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/synch-sem.cc\
          ../threads/dllist.cc\
          ../threads/dllist-driver.cc

THREAD_S = ../threads/switch.s

THREAD_O =main.o list.o scheduler.o  synchlist.o system.o thread.o \
	utility.o threadtest.o interrupt.o stats.o sysdep.o timer.o \
         synch-sem.o   dllist.o dllist-driver.o

USERPROG_H = ../userprog/addrspace.h\
	../userprog/bitmap.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\
	../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

VM_H = 
VM_C = 
VM_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) -P $(INCPATH) $(HOST) ../threads/switch.c > 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 'w' >>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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -