Makefile BSD
Overview
BSD makefile 내용 정리.
Conditional Statements(#if, #ifndef etc..)
.if $(VER) >= 2.4 TAG = 2.4_current .elif $(VER) == 2.3 TAG = 2.3_release .else TAG = 2.4_stable .endif
exists(<arg>)
해당 인자값(arg)이 존재하는지 여부를 리턴한다. 존재할 경우 1, 아니면 0을 리턴한다. 보통 .if 구문과 같이 쓰인다.
clean:
-rm -f *.o *.core
.if exists(tmp)
-rm tmp/*.o
.endif
See also
- https://wiki.netbsd.org/bsd_make/ - BSD make
- http://www.khmere.com/freebsd_book/html/ch01.html - FreeBSD System Programming Chapter 1