File: Makefile.in

package info (click to toggle)
cdebconf 0.182
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,668 kB
  • sloc: ansic: 16,289; sh: 547; makefile: 438; sql: 52; perl: 13
file content (108 lines) | stat: -rw-r--r-- 3,702 bytes parent folder | download
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
include ../globalmakeflags

SUBDIR=src

MAJOR=0
MINOR=0
MICRO=0
LDFLAGS += -L.
LIBS=-ldebconf -lpthread @LIBS@
LIBNAME=libdebconf.so
CLILIB=libdebconfclient.so
CLILIBNAME_A=libdebconfclient.a
CLILIBNAME=$(CLILIB).$(MAJOR).$(MINOR).$(MICRO)
CLISONAME=$(CLILIB).$(MAJOR)
DEBCONF=debconf
TOOLS=debconf-loadtemplate debconf-copydb debconf-communicate \
	debconf-dumpdb debconf-escape \
	debconf-get-selections debconf-set-selections \
	dpkg-reconfigure debconf-show dpkg-preconfigure
BIN=$(DEBCONF) $(TOOLS)

LIBOBJS=commands.opic configuration.opic confmodule.opic debug.opic \
	database.opic debconfclient.opic frontend.opic priority.opic \
	strutl.opic question.opic template.opic rfc822.opic plugin.opic

CLILIBOBJS=debconfclient.opic

CLILIBOBJS_A=$(CLILIBOBJS:.opic=.o)

all: $(BIN) $(LIBNAME) $(CLILIBNAME) $(CLILIBNAME_A) modules/Makefile client/confmodule
	@$(MAKE) -C modules $@

bin: $(BIN)

$(BIN): $(LIBNAME) $(addsuffix .o,$(BIN))
	@echo Compiling tool $@
	$(CC) $(CFLAGS) -o $@ $@.o @RPATH@ $(LDFLAGS) $(LIBS)

$(LIBNAME): $(LIBOBJS)
	@echo Creating library $@
	$(CC) $(CFLAGS) -shared -o $@ $(LDFLAGS) $^ -ldl @DI_LIBS@ @TEXTWRAP_LIBS@

$(CLILIBNAME): $(CLILIBOBJS)
	@echo Creating shared library $@
	$(CC) $(CFLAGS) -shared -Wl,-soname,$(CLISONAME) -o $@ $(LDFLAGS) $^

$(CLILIBNAME_A): $(CLILIBOBJS_A)
	$(AR) cr $@ $^
	ranlib $@

$(CLISONAME) $(CLILIB): $(CLILIBNAME)
	-@ln -sf $^ $@

commands-list.h: commands-list.in
	$(srcdir)/$(SUBDIR)/commands-list.h.build $< > $@

client/confmodule: commands-list.in debconfclient.h client/confmodule.in
	$(srcdir)/$(SUBDIR)/client/confmodule.build $^ > $@

confmodule.o confmodule.opic: commands-list.h

install:
	install -d -m 755 $(DESTDIR)${etcdir}
	install -d -m 755 $(DESTDIR)${libdir}
	install -d -m 755 $(DESTDIR)${moddir}
	install -m 755 debconf debconf-loadtemplate $(DESTDIR)${moddir}
	install -m 755 debconf-copydb debconf-dumpdb $(DESTDIR)${moddir}
ifneq ($(TARGET),udeb)
	install -m 755 debconf-communicate $(DESTDIR)${moddir}
	install -m 755 debconf-escape $(DESTDIR)${moddir}
	install -m 755 debconf-get-selections $(DESTDIR)${moddir}
	install -m 755 debconf-set-selections $(DESTDIR)${moddir}
	install -m 755 debconf-show $(DESTDIR)${moddir}
	install -m 755 dpkg-preconfigure $(DESTDIR)${moddir}
	install -m 755 dpkg-reconfigure $(DESTDIR)${moddir}
endif
	install -m 644 $(LIBNAME) $(DESTDIR)${moddir}
	install -m 644 $(CLILIBNAME) $(DESTDIR)${libdir}
	ln -sf $(CLILIBNAME) $(DESTDIR)${libdir}/$(CLISONAME)
	ln -sf $(CLILIBNAME) $(DESTDIR)${libdir}/$(CLILIB)
	install -m 644 $(CLILIBNAME_A) $(DESTDIR)${libdir}
	install -m 644 cdebconf.conf-dist $(DESTDIR)${etcdir}/cdebconf.conf
ifeq ($(TARGET),udeb)
	install -d -m 755 $(DESTDIR)${bindir}
	install -d -m 755 $(DESTDIR)${sbindir}
	install -d -m 755 $(DESTDIR)${sharedir}
	set -e; for p in debconf debconf-loadtemplate \
			debconf-copydb debconf-dumpdb; do \
		ln -sf ../lib/cdebconf/$$p $(DESTDIR)${bindir}; \
	done
	install -m 644 client/confmodule $(DESTDIR)${sharedir}
	ln -sf ../../lib/cdebconf/$(DEBCONF) $(DESTDIR)${sharedir}/frontend
else
	install -d -m 755 $(DESTDIR)${incdir}
	install -m 644 ${srcdir}/src/debconfclient.h $(DESTDIR)${incdir}
	install -m 644 ${srcdir}/src/question.h $(DESTDIR)${incdir}
	install -m 644 ${srcdir}/src/template.h $(DESTDIR)${incdir}
	install -m 644 ${srcdir}/src/constants.h $(DESTDIR)${incdir}
	install -m 644 ${srcdir}/src/frontend.h $(DESTDIR)${incdir}
	install -m 644 ${srcdir}/src/strutl.h $(DESTDIR)${incdir}
endif
	@$(MAKE) -C modules $@

clean:
	-@rm -f $(BIN) $(LIBNAME) $(CLILIB) $(CLILIBNAME) $(CLILIBNAME_A) $(CLISONAME) *~ *.o *.opic commands-list.h client/confmodule
	@$(MAKE) -C modules clean

.PHONY: all bin install clean