| Commit | Line | Data |
|---|---|---|
| 337ad0df DH |
1 | # $Id: Makefile,v 1.26 2005/04/05 19:40:46 cpressey Exp $ |
| 2 | ||
| 3 | OSTYPE!=sysctl -n kern.ostype | |
| 4 | ||
| 5 | PROG= dfuibe_installer | |
| 971d1cca MS |
6 | OBJS= fn_disk.o fn_configure.o fn_diagnostic.o fn_subpart_hammer.o \ |
| 7 | fn_subpart.o fn_install.o flow.o main.o | |
| 337ad0df DH |
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/ -laura -ldfui -linstaller | |
| 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 | # To build this straight from a checkout of the CVS tree, *without* first | |
| 41 | # installing the support libraries, do a 'make in_cvs'. This causes | |
| 42 | # search paths and symbolic links to be set up so that the build process | |
| 43 | # can find the needed header files and libraries. | |
| 44 | ||
| 45 | in_cvs: | |
| 46 | cd ../../lib/libaura && ${MAKE} in_cvs | |
| 47 | ln -sf ../../lib/libaura aura | |
| 48 | cd ../../lib/libdfui && ${MAKE} in_cvs | |
| 49 | ln -sf ../../lib/libdfui dfui | |
| 50 | cd ../../lib/libinstaller && ${MAKE} in_cvs | |
| 51 | ln -sf ../../lib/libinstaller installer | |
| 52 | ${MAKE} -DIN_CVS all | |
| 53 | ||
| 54 | .if defined(IN_CVS) | |
| 55 | CFLAGS+=-I. | |
| 56 | LDADD+= -L../../lib/libaura -L../../lib/libdfui -L../../lib/libinstaller | |
| 57 | .endif | |
| 58 | ||
| 59 | # Main target: | |
| 60 | ||
| 61 | ${PROG}: ${OBJS} | |
| 62 | ${CC} ${CFLAGS} ${OBJS} ${LDADD} -o ${PROG} | |
| 63 | ||
| 64 | # NLS (translated text) compilations: | |
| 65 | ||
| 66 | mo: | |
| 67 | for _language in ${LANGUAGES}; do \ | |
| 68 | msgfmt -o po/$${_language}.mo po/$${_language}; \ | |
| 69 | done | |
| 70 | ||
| 71 | # Translator templates: | |
| 72 | ||
| 73 | pot: | |
| 74 | xgettext -s --no-location --keyword=_ -o po/${PROG}.pot *.c | |
| 75 | ||
| 76 | # Cleaning up after ourselves: | |
| 77 | ||
| 78 | clean: | |
| 79 | rm -f aura dfui installer | |
| 80 | rm -rf ${PROG} *.o po/*.mo | |
| 81 | ||
| 82 | # Testing from within the CVS checkout. | |
| 83 | ||
| 84 | test: in_cvs | |
| 85 | env LD_LIBRARY_PATH="../../lib/libaura:../../lib/libdfui:../../lib/libinstaller" ./${PROG} |