다음을 통해 공유


컴파일 및 연결

다음 메이크파일은 클라이언트 및 서버 애플리케이션을 컴파일하고 RPC 런타임 라이브러리 및 표준 C 런타임 라이브러리에 연결하는 데 필요한 파일 간의 종속성을 보여 줍니다.

이 메이크파일은 이 자습서의 소스 코드에서 클라이언트 및 서버 애플리케이션을 빌드하는 데 사용할 수 있습니다. 여기에 표시된 스텁 및 헤더는 MIDL 버전 2.0을 사용하여 생성되었습니다. 컴파일러 및 링커 명령 및 인수는 컴퓨터 구성에 따라 다를 수 있습니다. 자세한 내용은 컴파일러 설명서를 참조하세요.

#makefile for helloc.exe and hellos.exe
#link refers to the linker
#conflags refers to flags for console applications
#conlibs refers to libraries for console applications
 
!include <ntwin32.mak>
 
all : helloc hellos
 
# Make the client side application helloc
helloc : helloc.exe
helloc.exe : helloc.obj hello_c.obj
    $(link) $(linkdebug) $(conflags) -out:helloc.exe \
        helloc.obj hello_c.obj \
        rpcrt4.lib $(conlibs)
 
# helloc main program
helloc.obj : helloc.c hello.h
    $(cc) $(cdebug) $(cflags) $(cvars) $*.c
 
# helloc stub
hello_c.obj : hello_c.c hello.h
    $(cc) $(cdebug) $(cflags) $(cvars) $*.c
 
# Make the server side application
hellos : hellos.exe
hellos.exe : hellos.obj hellop.obj hello_s.obj
    $(link) $(linkdebug) $(conflags) -out:hellos.exe \
        hellos.obj hello_s.obj hellop.obj \
        rpcrt4.lib $(conlibsmt)
 
# hello server main program
hellos.obj : hellos.c hello.h
    $(cc) $(cdebug) $(cflags) $(cvarsmt) $*.c
 
# remote procedures
hellop.obj : hellop.c hello.h
    $(cc) $(cdebug) $(cflags) $(cvarsmt) $*.c
 
# hellos stub file
hello_s.obj : hello_s.c hello.h
    $(cc) $(cdebug) $(cflags) $(cvarsmt) $*.c
 
# Stubs and header file from the IDL file
hello.h hello_c.c hello_s.c : hello.idl hello.acf
    midl hello.idl