xref: /freebsd/contrib/bsddialog/utility/GNUmakefile (revision c8e7f78a3d28ff6e6223ed136ada8e1e2f34965e)
1# PUBLIC DOMAIN - NO WARRANTY, see:
2#     <http://creativecommons.org/publicdomain/zero/1.0/>
3#
4# Written in 2021 by Alfonso Sabato Siciliano
5
6OUTPUT =  bsddialog
7SOURCES = bsddialog.c util_builders.c util_cli.c util_theme.c
8OBJECTS = $(SOURCES:.c=.o)
9
10ifneq ($(ENABLEDEBUG),)
11CFLAGS += -g
12endif
13CFLAGS += -D_GNU_SOURCE -Wall -Wextra -I$(LIBPATH)
14
15ifneq ($(DISABLERPATH),)
16LDFLAGS += -ltinfo -L$(LIBPATH) -lbsddialog
17else
18LDFLAGS += -ltinfo -Wl,-rpath=$(LIBPATH) -L$(LIBPATH) -lbsddialog
19endif
20
21RM = rm -f
22
23all : $(OUTPUT)
24
25$(OUTPUT): $(OBJECTS)
26	$(CC) $^ -o $@ $(LDFLAGS)
27
28
29%.o: %.c
30	$(CC) $(CFLAGS) -c $<
31
32clean:
33	$(RM) $(OUTPUT) *.o *~
34