forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makelist
executable file
·130 lines (119 loc) · 4.07 KB
/
makelist
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/make -f
#
#
# Normal variables derived from passed variables
LPATH := $(PREFIX)/lib/root
IPATH := $(PREFIX)/include/root
BPATH := $(PREFIX)/bin
MPATH := $(PREFIX)/share/man/man1
SOEXT := so
MAJOR := $(shell echo $(VERSION) | tr '.' ' ' | cut -f1 -d' ')
MINOR := $(shell echo $(VERSION) | tr '.' ' ' | cut -f2 -d' ')
SOVER := $(MAJOR).$(MINOR)
RLIBD := $(PREFIX)/lib/root
# Put all library files into version-specific lists
ifneq ($(LIB),$(DEV))
SLIB := $(LIB)$(SOVER)
else
SLIB := $(LIB)
endif
ifneq ($(LIB),$(BIN))
SBIN := $(BIN)
else
SBIN := $(SLIB)
endif
# Include general and directory specific make rules
ifneq ($(DIRS),)
include config/Makefile.config
include config/Makefile.$(ARCH)
include $(foreach i, $(DIRS), $(i)/Module.mk)
# Special case of xrootd
ifeq ($(DIRS), net/xrootd)
XRDLIBS := $(patsubst lib/%, $(LPATH)/%, \
$(filter-out lib/libXrdProofd.so, $(wildcard lib/libXrd*.so)))
ALLLIBS := $(XRDLIBS:$(RLIBD)/%=$(RLIBD)/%)
ALLEXECS:= $(filter-out bin/xrootd bin/olbd, $(ALLEXECS))
endif # $(DIRS) = xrootd
endif # ! $(DIRS) =
ifneq ($(filter cint/cint,$(DIRS)),)
include cint/ROOT/cintdlls.mk
DICTLIBS += $(patsubst lib/%, $(RLIBD)/%, $(filter lib/%, $(CINTDICTDLLS)))
ALLMAPS = $(patsubst lib/%, $(RLIBD)/%, $(filter lib/%, $(CINTDICTMAPS)))
endif
# Default target and message
all: hello liblist devlist binlist
hello:
@echo "Making list for '$(DIRS)' ($(SLIB),$(DEV),$(SBIN))"
# @echo "ALLLIBS=$(ALLLIBS) ALLMAPS=$(ALLMAPS) PKGLIBS=$(PKGLIBS)"
# If we have a development package, get the list of headers.
ifneq ($(DEV),)
PKGHDRS := $(shell echo $(ALLHDRS) | sed -e 's,[^ ]*inc/,include/,g' -e 's,include/,usr/include/root/,g')
endif
# If we have a Library, then we get the list of libraries
ifneq ($(LIB),)
# if the development package and the library package is not the same,
# we need to append the soversion to the library directory
ifneq ($(LIB),$(DEV))
PKGLIBS := $(ALLLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%.$(SOVER)) \
$(ALLLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%.$(MAJOR)) \
$(ALLLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%) \
$(ALLLIBS:$(RLIBD)/%=$(RLIBD)/%.$(SOVER)) \
$(DICTLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%.$(SOVER)) \
$(DICTLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%.$(MAJOR)) \
$(DICTLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%)
DEVLIBS := $(ALLLIBS)
else # ! $(LIB) = $(DEV)
# If the development and library package is the same (plugins), then we need
# only add the soversion to the library directory
ifeq ($(DIRS), net/xrootd)
PKGLIBS := $(ALLLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%)
else
PKGLIBS := $(ALLLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%.$(SOVER)) \
$(ALLLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%.$(MAJOR)) \
$(ALLLIBS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%)
endif # $(DIRS) = net/xrootd
endif # $(LIB) = $(DEV)
endif # $(LIB)
ifneq ($(NOMAP),1)
#NOXRD := $(filter-out $(LIBPATH)/libXrd%, $(ALLLIBS))
#PKGLIBS := $(PKGLIBS) $(NOXRD:$(RLIBD)/%.so=$(RLIBD)/$(SOVER)/%.rootmap)
PKGLIBS := $(PKGLIBS) $(ALLMAPS:$(RLIBD)/%=$(RLIBD)/$(SOVER)/%)
endif
# The rule to make library lists
liblist:
ifneq ($(LIB),)
@for f in $(PKGLIBS) ; do echo $$f ; done >> $(OUT)/$(SLIB).install
ifneq ($(LIB), $(DEV))
@(cd $(BUILD)/$(RLIBD) && \
for i in $(ALLLIBS) ; do \
b=`basename $$i` ; \
ln -fs $(SOVER)/$$b . ; \
ln -fs $(SOVER)/$$b.$(SOVER) . ; done)
endif # $(LIB) = $(DEV)
endif # $(LIB)
# If we have a development library, get the list of headers for the package.
ifneq ($(DEV),)
PKGHDRS := $(ALLHDRS:include/%=$(IPATH)/%) $(DEVLIBS)
endif # $(DEV)
# Rule to make development package list
devlist:
ifneq ($(DEV),)
ifneq ($(DEV),$(LIB))
@for f in $(filter-out %.cw %.pri, $(PKGHDRS)) ; \
do echo $$f ; done >> $(OUT)/$(DEV).install
endif
endif
# If we have a binary package, then get list of programs and man pages
ifneq ($(BIN),)
PKGEXECS= $(ALLEXECS:bin/%=$(BPATH)/%)
PKGMANS = $(ALLEXECS:bin/%=$(MPATH)/%.1)
endif # $(BIN)
# Rule to make program package list
binlist:
ifneq ($(BIN),)
@for f in $(PKGEXECS) ; do echo $$f ; done >> $(OUT)/$(SBIN).install
@for f in $(PKGMANS) ; do echo $$f\* ; done >> $(OUT)/$(SBIN).install
endif
#
# EOF
#