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