summaryrefslogtreecommitdiff
path: root/dselect/Makefile.in
blob: d14ea97282d640e79184061344997ba94b6aa9a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
VPATH		= @srcdir@
srcdir		= @srcdir@
top_srcdir	= @top_srcdir@
top_builddir	= ..

include ../Makefile.conf

CXX_SOURCES	= basecmds.cc baselist.cc basetop.cc bindings.cc curkeys.cc \
		  main.cc methkeys.cc methlist.cc method.cc methparse.cc \
		  pkgcmds.cc pkgdepcon.cc pkgdisplay.cc pkginfo.cc pkgkeys.cc \
		  pkglist.cc pkgsublist.cc pkgtop.cc helpmsgs.cc

MAN8PAGES	= dselect.8

OBJECTS		= $(patsubst %.cc, %.o, $(CXX_SOURCES))
GENFILES	= $(OBJECTS) dselect helpmsgs.h curkeys.h \
		  $(srcdir)/helpmsgs.h $(srcdir)/helpmsgs.cc

.PHONY: all
all:: dselect

.PHONY: install
install:: all

.PHONY: clean
clean::
	$(RM) $(GENFILES)

.PHONY: distclean
cvslean:: clean
	$(RM) Makefile

.PHONY: install
install:: install-program install-doc

.PHONY: install-program
install-program:
	$(mkinstalldirs) $(DESTDIR)/$(bindir)
	$(INSTALL) dselect $(DESTDIR)/$(bindir)

.PHONY: install-doc
install-doc:
	$(mkinstalldirs) $(DESTDIR)/$(man8dir)
	set -e ; for i in $(MAN8PAGES) ; do \
	    if test -f $$i ; then d= ; else d="$(srcdir)/" ; fi ; \
	    $(INSTALL_DATA) $$d$$i $(DESTDIR)/$(man8dir) ; \
	done

dselect: $(OBJECTS) ../lib/libdpkg.a
	$(CXX) $(LDFLAGS) -L../lib -o $@ $(OBJECTS) $(LIBS) $(NLS_LIBS) -ldpkg -lncurses

basecmds.o: helpmsgs.h
curkeys.o: curkeys.h

$(srcdir)/helpmsgs.h $(srcdir)/helpmsgs.cc: helpmsgs.src $(srcdir)/mkhelpmsgs.pl
	cd $(srcdir) ; perl mkhelpmsgs.pl helpmsgs.src

curkeys.h: keyoverride $(srcdir)/mkcurkeys.pl
	cursesfile=`echo '#include <curses.h>' | \
		 $(CC) -E - | grep 'curses.h' | head -1 | \
		 $(SED) -e 's/^[^"]*"//; s/".*$$//'`; \
	if [ "$$cursesfile" = "" ]; then echo "can't find curses file"; exit 1; fi; \
	perl $(srcdir)/mkcurkeys.pl $< $$cursesfile > $@