1# Any copyright is dedicated to the Public Domain, see: 2# <http://creativecommons.org/publicdomain/zero/1.0/> 3# 4# Written by Alfonso Sabato Siciliano 5 6VERSION = 0.1 7LIBRARY = bsddialog 8LIBRARY_SO = lib${LIBRARY:=.so} 9HEADERS = bsddialog.h bsddialog_theme.h 10SOURCES = barbox.c editorbox.c formbox.c lib_util.c menubox.c textbox.c \ 11 timebox.c commandbox.c filebox.c infobox.c libbsddialog.c messagebox.c \ 12 theme.c 13OBJECTS= ${SOURCES:.c=.o} 14FBSDFLAGS= -O2 -pipe -std=gnu99 -Wno-format-zero-length \ 15 -fstack-protector-strong -Qunused-arguments 16CFLAGS = -I/usr/local/include -fPIC -Wall -Wextra ${FBSDFLAGS} 17LDFLAGS = -fstack-protector-strong -shared -Wl,-x -Wl,--fatal-warnings \ 18 -Wl,--warn-shared-textrel -Wl,-soname,${LIBRARY_SO}.${VERSION} 19 20INSTALL_PREFIX=/usr/local 21LN = ln -s -f 22RM = rm -f 23CP = cp 24GZIP = gzip -cn 25LDCONFIG = /sbin/ldconfig -m 26 27.if defined(PORTNCURSES) 28# PORT ncurses `make -DPORTNCURSES` or `make -D PORTNCURSES` 29CFLAGS += -DPORTNCURSES -I/usr/local/include 30LDFLAGS += -L/usr/local/lib -lform -lncurses -ltinfo 31.else 32# BASE ncurses 33LDFLAGS += -L/usr/lib -lform -lncurses -ltinfo 34.endif 35 36MAN= ${OUTPUT}.3 37GZIP= gzip -cn 38MANDIR= /usr/local/share/man/man3 39 40INSTALL= install 41RM= rm -f 42 43#all : man ${LIBRARY} 44all : ${LIBRARY} 45 46${LIBRARY}: ${OBJECTS} 47 ${CC} ${LDFLAGS} ${.ALLSRC} -o ${LIBRARY_SO}.${VERSION} 48 # LN for devel 49 ${LN} ${LIBRARY_SO}.${VERSION} ${LIBRARY_SO} 50 51.c.o: 52 ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} 53 54man: 55 ${GZIP} ${LIBRARY}.3 > ${LIBRARY}.3.gz 56 57clean: 58 ${RM} ${LIBRARY_SO}* *.o *~ *.gz 59 60 61install: 62 ${CP} ${LIBRARY}.h ${INSTALL_PREFIX}/include 63 ${CP} ${LIBRARY_SO}.${VERSION} ${INSTALL_PREFIX}/lib/ 64 ${LN} ${INSTALL_PREFIX}/lib/${LIBRARY_SO}.${VERSION} ${INSTALL_PREFIX}/lib/${LIBRARY_SO} 65 ${LDCONFIG} ${INSTALL_PREFIX}/lib 66 ${CP} ${LIBRARY}.3.gz ${INSTALL_PREFIX}/man/man3/ 67 68unistall: 69 ${RM} ${INSTALL_PREFIX}/include/${LIBRARY}.h 70 ${RM} ${INSTALL_PREFIX}/lib/${LIBRARY_SO} 71 ${RM} ${INSTALL_PREFIX}/lib/${LIBRARY_SO}.${VERSION} 72 ${LDCONFIG} ${INSTALL_PREFIX}/lib 73 ${RM} ${INSTALL_PREFIX}/man/man3/${LIBRARY}.3.gz 74