https://casys-kaist.github.io/pintos-kaist/introduction/grading.html
가장 처음에 실해하고 싶은건, 일단 테스트가 가능한지였다. 어떻게 테스트를 실행하는지를 모르니, 작성해도 제대로 동작하는지 확인할 방법이 없었다.
build 디렉토리에서 테스트를 실행해야하지만, 처음에는 없다. make 명령어를 이용해 만들어주어야한다.
make 명령어는 Makefile에 적힌 규칙을 읽고, 자동으로 실행하는 도구다. 사용하는 우분투 환경에서는 make 명령어가 등록되어있다.
jungle@d1a5a50b8fc0:/workspaces/code/pintos$ which make
/usr/bin/make
결과는 아래와 같이 빌드 디렉토리가 생성된다.
34+0 records out
139264 bytes (139 kB, 136 KiB) copied, 0.0503643 s, 2.8 MB/s
rm kernel.bin.tmp
gcc -c ../../threads/loader.S -o threads/loader.o -Wa,--gstabs -mcmodel=large -nostdinc -I../.. -I../../include/lib -I../../include -I../../include/lib/kernel -I../../lib/kernel -DKERNEL_LOAD_PAGES=`perl -e 'print +(-s "kernel.bin") / 4096;'`
ld --no-relax -N -e start -Ttext 0x7c00 --oformat binary -o loader.bin threads/loader.o
cat loader.bin kernel.bin > os.dsk
make[1]: Leaving directory '/workspaces/code/pintos/threads/build'
target: dependency
cammand (여기서는 반드시 tab 사용)
target을 사용할때는 dependecy가 필요하다.
depencency를 만들거 내기 위해 command를 실행하라.
$(make)
Makefile 내에서 make를 실행하라는 표현
include ../Makefile.kernel
파일 안에는 상위 디렉토리에 있는 makefile을 언급하고 있다.