Installer import into contrib (real import this time)
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / src / backend / test / Makefile
1 # Makefile for dfuibe_test.
2 # $Id: Makefile,v 1.15 2005/04/05 19:40:46 cpressey Exp $
3
4 OSTYPE!=sysctl -n kern.ostype
5
6 PROG=   dfuibe_test
7 OBJS=   be_test.o
8
9 WARNS=  -W -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
10         -Wpointer-arith -Wno-uninitialized -Wreturn-type -Wcast-qual \
11         -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts \
12         -Winline -Wnested-externs -Wredundant-decls
13
14 CFLAGS+=${WARNS} -I/usr/local/include
15 .ifdef DEBUG
16 CFLAGS+=-g -DDEBUG
17 .endif
18 LDADD+= -L/usr/local/lib/ -ldfui -laura
19
20 .if ${OSTYPE} == "NetBSD"
21 CFLAGS+= -I/usr/pkg/include
22 LDADD+= -L/usr/pkg/lib
23 .endif
24
25 .if defined(WITH_NLS)
26 # Localization (gettext)
27 LOCALEDIR=      /usr/local/share/locale
28 PACKAGE=        ${PROG}
29 CFLAGS+=        -DLOCALEDIR=\"${LOCALEDIR}\"
30 CFLAGS+=        -DPACKAGE=\"${PACKAGE}\"
31 CFLAGS+=        -DENABLE_NLS
32 LDADD+=         -lintl
33 LANGUAGES=      ru
34 .endif
35
36 # Default target.
37
38 all: ${PROG} mo
39
40 # Build directly from CVS checkout.
41
42 in_cvs:
43         cd ../../lib/libaura && ${MAKE} in_cvs
44         ln -sf ../../lib/libaura aura
45         cd ../../lib/libdfui && ${MAKE} in_cvs
46         ln -sf ../../lib/libdfui dfui
47         ${MAKE} -DIN_CVS all
48
49 .if defined(IN_CVS)
50 CFLAGS+=-I.
51 LDADD+= -L../../lib/libaura -L../../lib/libdfui
52 .endif
53
54 # Main target.
55
56 ${PROG}: ${OBJS}
57         ${CC} ${CFLAGS} ${OBJS} ${LDADD} -o ${PROG}
58
59 mo:
60         for _language in ${LANGUAGES}; do \
61                 msgfmt -o po/$${_language}.mo po/$${_language}; \
62         done
63
64 pot:
65         xgettext -s --no-location --keyword=_ -o po/${PROG}.pot *.c
66
67 # XXX This is here only because there is no port for this.
68 install: mo
69         for _language in ${LANGUAGES}; do \
70                 ${INSTALL} -c -o root -g wheel -m 444 po/$${_language}.mo \
71                     ${LOCALEDIR}/$${_language}/LC_MESSAGES/${PACKAGE}.mo; \
72         done
73
74 clean:
75         rm -f aura dfui
76         rm -rf ${PROG} *.o po/*.mo
77
78 # In-CVS-tree testing
79
80 test: in_cvs
81         env LD_LIBRARY_PATH="../../lib/libaura:../../lib/libdfui" ./${PROG}