Makefile BSD: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| No edit summary | No edit summary | ||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| == Overview == | == Overview == | ||
| BSD makefile 내용 정리. | BSD makefile 내용 정리. | ||
| == bmake == | |||
| <source lang=bash> | |||
| $ bmake | |||
| </source> | |||
| == include statements, conditionals and for loops == | |||
| '''Example''' | |||
| <pre> | |||
| .if $(VER) >= 2.4 | |||
|   TAG = 2.4_current | |||
| .elif $(VER) == 2.3 | |||
|   TAG = 2.3_release | |||
| .else | |||
|   TAG = 2.4_stable | |||
| .endif | |||
| </pre> | |||
| === .include === | |||
| 지정한 파일을 첨부한다. 보통 필요한 *.mk 파일들을 첨부하는데 사용한다. | |||
| <pre> | |||
| RDIR=../../../.. | |||
| .include "${RDIR}/common/Mk/pre.mk" | |||
| </pre> | |||
| === exists(<arg>) === | |||
| 해당 인자값(arg)이 존재하는지 여부를 리턴한다. 존재할 경우 1, 아니면 0을 리턴한다. 보통 .if 구문과 같이 쓰인다. | |||
| <pre> | |||
| clean: | |||
|     -rm -f *.o *.core | |||
| .if exists(tmp) | |||
|     -rm tmp/*.o | |||
| .endif | |||
| </pre> | |||
| == See also == | == See also == | ||
| * https://www.freebsd.org/cgi/man.cgi?make(1) - BSD make manual | |||
| * https://wiki.netbsd.org/bsd_make/ - BSD make | * https://wiki.netbsd.org/bsd_make/ - BSD make | ||
| * http://www.khmere.com/freebsd_book/html/ch01.html - FreeBSD System Programming Chapter 1 | * http://www.khmere.com/freebsd_book/html/ch01.html - FreeBSD System Programming Chapter 1 | ||
| [[category:makefile]] | [[category:makefile]] | ||
Latest revision as of 13:57, 16 August 2016
Overview
BSD makefile 내용 정리.
bmake
<source lang=bash> $ bmake </source>
include statements, conditionals and for loops
Example
.if $(VER) >= 2.4 TAG = 2.4_current .elif $(VER) == 2.3 TAG = 2.3_release .else TAG = 2.4_stable .endif
.include
지정한 파일을 첨부한다. 보통 필요한 *.mk 파일들을 첨부하는데 사용한다.
RDIR=../../../..
.include "${RDIR}/common/Mk/pre.mk"
exists(<arg>)
해당 인자값(arg)이 존재하는지 여부를 리턴한다. 존재할 경우 1, 아니면 0을 리턴한다. 보통 .if 구문과 같이 쓰인다.
clean:
    -rm -f *.o *.core
.if exists(tmp)
    -rm tmp/*.o
.endif
See also
- https://www.freebsd.org/cgi/man.cgi?make(1) - BSD make manual
- https://wiki.netbsd.org/bsd_make/ - BSD make
- http://www.khmere.com/freebsd_book/html/ch01.html - FreeBSD System Programming Chapter 1