Linux_system

apue.3e 컴파일 하기

MasterOfAI 2022. 12. 9. 23:23

Advanced Programming in the UNIX Environment Thrd Edition 의 예제를 compile 하려면 다음과 같이 하면 된다.

Source code download : https://github.com/vdpa4me/apue.git

 

vdpa4me/apue

Example of Advanced Programming in the UNIX Environment - vdpa4me/apue

github.com

 

/apue/apue.3e/lib 로 이동한다. 
Makefile 을 editor 로 열어서, 아래 부분을 수정한다. 
PLATFORM=$(shell $(ROOT)/systype.sh) 부분을 PLATFORM=linux 로 변경한다. 
(systype.sh 실행시 permission denine error 발생)
make 명령어로 libapue.a 를 build 한다. 

 

/apue/apue.3e/intro/myls.c 를 생성하고 코딩한다. 

다음과 같이 build 한다. 

gcc -I ../include/ myls.c -o myls -L ../lib/ -lapue