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