1# PUBLIC DOMAIN - NO WARRANTY, see: 2# <http://creativecommons.org/publicdomain/zero/1.0/> 3# 4# Written in 2021 by Alfonso Sabato Siciliano 5 6LIBRARY = bsddialog 7LIBRARY_SO = lib${LIBRARY:=.so} 8HEADERS = bsddialog.h bsddialog_theme.h bsddialog_progressview.h 9SOURCES = barbox.c datebox.c formbox.c libbsddialog.c lib_util.c \ 10 menubox.c messagebox.c textbox.c theme.c timebox.c 11OBJECTS = $(SOURCES:.c=.o) 12 13ifneq ($(ENABLEDEBUG),) 14CFLAGS += -g 15endif 16CFLAGS += -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE -D_GNU_SOURCE \ 17 -Wall -Wextra -Werror -fpic 18LDFLAGS += -lncursesw -ltinfo 19LIBFLAG = -shared 20 21RM = rm -f 22LN = ln -s -f 23 24all : $(LIBRARY) 25 26$(LIBRARY): $(OBJECTS) 27 $(CC) $(LIBFLAG) $^ -o $(LIBRARY_SO).$(VERSION) $(LDFLAGS) 28 ${LN} ${LIBRARY_SO}.${VERSION} ${LIBRARY_SO} 29 30%.o: %.c $(HEADERS) 31 $(CC) $(CFLAGS) -c $< 32 33clean: 34 $(RM) $(LIBRARY_SO)* *.o *~ 35