Annotation of src/share/mk/bsd.prog.mk, Revision 1.51
1.51 ! guenther 1: # $OpenBSD: bsd.prog.mk,v 1.50 2010/11/18 21:16:57 miod Exp $
1.3 deraadt 2: # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $
1.1 deraadt 3: # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
4:
5: .if exists(${.CURDIR}/../Makefile.inc)
6: .include "${.CURDIR}/../Makefile.inc"
7: .endif
8:
9: .include <bsd.own.mk>
10:
1.47 deraadt 11: .SUFFIXES: .out .ln .o .c .cc .C .cxx .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
1.1 deraadt 12:
1.24 espie 13: .if ${WARNINGS:L} == "yes"
14: CFLAGS+= ${CDIAGFLAGS}
15: CXXFLAGS+= ${CXXDIAGFLAGS}
16: .endif
1.18 millert 17: CFLAGS+= ${COPTS}
1.24 espie 18: CXXFLAGS+= ${CXXOPTS}
1.1 deraadt 19:
1.48 brad 20: .if ${ELF_TOOLCHAIN:L} == "yes"
1.8 niklas 21: CRTBEGIN?= ${DESTDIR}/usr/lib/crtbegin.o
22: CRTEND?= ${DESTDIR}/usr/lib/crtend.o
23: .endif
24:
1.1 deraadt 25: LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
1.31 espie 26: LIBASN1?= ${DESTDIR}/usr/lib/libasn1.a
1.1 deraadt 27: LIBC?= ${DESTDIR}/usr/lib/libc.a
28: LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
1.50 miod 29: LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a
1.31 espie 30: LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a
1.1 deraadt 31: LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
32: LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
1.32 millert 33: LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a
1.50 miod 34: LIBEXPAT?= ${DESTDIR}/usr/lib/libexpat.a
35: LIBFORM?= ${DESTDIR}/usr/lib/libform.a
36: LIBFORMW?= ${DESTDIR}/usr/lib/libformw.a
1.37 jakob 37: LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a
1.31 espie 38: LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a
39: LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a
40: LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a
41: LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a
1.21 ho 42: LIBKEYNOTE?= ${DESTDIR}/usr/lib/libkeynote.a
1.31 espie 43: LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a
1.1 deraadt 44: LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
1.3 deraadt 45: LIBL?= ${DESTDIR}/usr/lib/libl.a
1.1 deraadt 46: LIBM?= ${DESTDIR}/usr/lib/libm.a
1.50 miod 47: LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a
48: LIBMENUW?= ${DESTDIR}/usr/lib/libmenuw.a
1.4 tholo 49: LIBOLDCURSES?= ${DESTDIR}/usr/lib/libocurses.a
1.50 miod 50: LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a
51: LIBPANEL?= ${DESTDIR}/usr/lib/libpanel.a
52: LIBPANELW?= ${DESTDIR}/usr/lib/libpanelw.a
1.31 espie 53: LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
1.20 millert 54: LIBPERL?= ${DESTDIR}/usr/lib/libperl.a
1.50 miod 55: LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a
1.1 deraadt 56: LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
57: LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
1.50 miod 58: LIBSNDIO?= ${DESTDIR}/usr/lib/libsndio.a
1.19 beck 59: LIBSSL?= ${DESTDIR}/usr/lib/libssl.a
1.1 deraadt 60: LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
1.4 tholo 61: LIBTERMLIB?= ${DESTDIR}/usr/lib/libtermlib.a
1.31 espie 62: LIBUSB?= ${DESTDIR}/usr/lib/libusbhid.a
1.1 deraadt 63: LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
1.11 downsj 64: LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
1.3 deraadt 65: LIBY?= ${DESTDIR}/usr/lib/liby.a
1.9 mickey 66: LIBZ?= ${DESTDIR}/usr/lib/libz.a
1.31 espie 67:
1.48 brad 68: .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "amd64" || \
1.50 miod 69: ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386"
1.39 miod 70: LIBARCH?= ${DESTDIR}/usr/lib/lib${MACHINE_ARCH}.a
1.31 espie 71: .else
72: LIBARCH?=
73: .endif
1.1 deraadt 74:
75: .if defined(PROG)
76: SRCS?= ${PROG}.c
1.42 espie 77: . if !empty(SRCS:N*.h:N*.sh)
1.51 ! guenther 78: OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/}
1.49 otto 79: _LEXINTM+=${SRCS:M*.l:.l=.c}
80: _YACCINTM+=${SRCS:M*.y:.y=.c}
1.47 deraadt 81: LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} ${SRCS:M*.y:.y=.ln} ${SRCS:M*.l:.l=.ln}
1.42 espie 82: . endif
1.1 deraadt 83:
1.42 espie 84: . if defined(OBJS) && !empty(OBJS)
85: . if !empty(SRCS:M*.C) || !empty(SRCS:M*.cc) || !empty(SRCS:M*.cxx)
1.8 niklas 86: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD}
1.42 espie 87: ${CXX} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
88: . else
1.8 niklas 89: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD}
1.41 espie 90: ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.42 espie 91: . endif
92: . endif # defined(OBJS) && !empty(OBJS)
1.41 espie 93:
1.42 espie 94: . if !defined(MAN)
1.1 deraadt 95: MAN= ${PROG}.1
1.42 espie 96: . endif # !defined(MAN)
1.1 deraadt 97: .endif # defined(PROG)
98:
99: .MAIN: all
100: all: ${PROG} _SUBDIRUSE
101:
102: .if !target(clean)
103: clean: _SUBDIRUSE
1.49 otto 104: rm -f a.out [Ee]rrs mklog core *.core y.tab.h \
105: ${PROG} ${OBJS} ${LOBJS} ${_LEXINTM} ${_YACCINTM} ${CLEANFILES}
1.1 deraadt 106: .endif
107:
108: cleandir: _SUBDIRUSE clean
109:
110: .if !target(install)
111: .if !target(beforeinstall)
112: beforeinstall:
113: .endif
114: .if !target(afterinstall)
115: afterinstall:
116: .endif
117:
118: .if !target(realinstall)
119: realinstall:
120: .if defined(PROG)
1.13 millert 121: ${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} \
1.43 espie 122: -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/${PROG}
1.1 deraadt 123: .endif
1.46 espie 124: .endif
125:
126: install: maninstall _SUBDIRUSE
1.1 deraadt 127: .if defined(LINKS) && !empty(LINKS)
1.28 espie 128: . for lnk file in ${LINKS}
129: @l=${DESTDIR}${lnk}; \
130: t=${DESTDIR}${file}; \
131: echo $$t -\> $$l; \
132: rm -f $$t; ln $$l $$t
133: . endfor
1.1 deraadt 134: .endif
135:
136: maninstall: afterinstall
137: afterinstall: realinstall
138: realinstall: beforeinstall
139: .endif
140:
141: .if !target(lint)
142: lint: ${LOBJS}
143: .if defined(LOBJS) && !empty(LOBJS)
144: @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
145: .endif
146: .endif
147:
148: .if !defined(NOMAN)
149: .include <bsd.man.mk>
150: .endif
151:
152: .if !defined(NONLS)
153: .include <bsd.nls.mk>
154: .endif
155:
156: .include <bsd.obj.mk>
157: .include <bsd.dep.mk>
158: .include <bsd.subdir.mk>
1.3 deraadt 159: .include <bsd.sys.mk>