summaryrefslogtreecommitdiffstats
path: root/rules.mk
blob: 0eb4cab48eac783a8d1add318c89af3401131807 (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
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


VPATH = $(srcdir)

CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/lib -I$(builddir)

# we need paths to be overridable at build-time
DEFS += '-DPREFIX="$(prefix)"' '-DPKG_SHARE_DIR="$(pkgdatadir)"' \
	'-DLOCAL_STATE_DIR="$(localstatedir)"'

#uis = ui/twin/pb-twin
uis = ui/test/pb-test
#parsers = native yaboot kboot
parsers = kboot
artwork = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz

log_objs = lib/log/log.o
talloc_objs = lib/talloc/talloc.o
list_objs = lib/list/list.o
waiter_objs = lib/waiter/waiter.o
server_objs = lib/pb-protocol/pb-protocol.o
parser_objs = discover/parser.o discover/parser-utils.o \
	      $(foreach p, $(parsers), discover/$(p)-parser.o)

parser_test_objs = parser-test.o $(parser_objs)

all: $(uis) discover/pb-discover

# twin gui
ui/twin/pb-twin: LDFLAGS+=$(twin_LDFLAGS)
ui/twin/pb-twin: CFLAGS+=$(twin_CFLAGS)

pb_twin_objs = ui/twin/pb-twin.o ui/common/devices.o

ui/twin/pb-twin: $(pb_twin_objs)
	$(LINK.o) -o $@ $^

# test ui
pb_test_objs = ui/test/pb-test.o ui/common/discover-client.o \
	$(log_objs) $(talloc_objs) $(server_objs) $(list_objs)

ui/test/pb-test: $(pb_test_objs)
	$(LINK.o) -o $@ $^

# discovery daemon
#pb_discover_objs = discover/params.o discover/parser.o discover/paths.o \
#	      discover/yaboot-cfg.o \
#	      $(foreach p,$(parsers),discover/$(p)-parser.o)

pb_discover_objs = discover/pb-discover.o discover/udev.o \
		   discover/discover-server.o discover/device-handler.o \
		   discover/paths.o $(talloc_objs) $(server_objs) \
		   $(parser_objs) $(list_objs) $(waiter_objs) $(log_objs)

discover/pb-discover: $(pb_discover_objs)
	$(LINK.o) -o $@ $^


parser-test: $(parser_test_objs)
	$(LINK.o) -o $@ $^

install: all
	$(INSTALL) -d $(DESTDIR)$(sbindir)/
	$(INSTALL) discover/pb-discover $(uis) $(DESTDIR)$(sbindir)/
	$(INSTALL) -d $(DESTDIR)$(pkgdatadir)/artwork/
	$(INSTALL) $(addprefix $(top_srcdir)/ui/twin/artwork/,$(artwork)) \
		$(DESTDIR)$(pkgdatadir)/artwork/

dist:	$(PACKAGE)-$(VERSION).tar.gz

check:	parser-test
	devices/parser-test.sh

distcheck: dist
	tar -xvf $(PACKAGE)-$(VERSION).tar.gz
	cd $(PACKAGE)-$(VERSION) && make check

$(PACKAGE)-$(VERSION).tar.gz: $(PACKAGE)-$(VERSION)
	tar czvf $@ $^

$(PACKAGE)-$(VERSION): clean
	for f in $$(git-ls-files); do \
		d=$@/$$(dirname $$f); \
		mkdir -p $$d; \
		cp -a $$f $$d; \
	done
clean:
	rm -rf $(PACKAGE)-$(VERSION)
	rm -f $(uis)
	rm -f $(pb_twin_objs) $(pb_test_objs)
	rm -f $(pb_discover_objs)
	rm -f discover/pb-discover
	rm -f ui/test/pb-test

OpenPOWER on IntegriCloud