File: LinuxLib

package info (click to toggle)
ncl 6.3.0-13
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 196,648 kB
  • ctags: 70,631
  • sloc: ansic: 603,601; fortran: 441,469; sed: 11,222; csh: 8,350; yacc: 4,253; xml: 1,928; sh: 1,526; lex: 1,266; python: 1,067; f90: 652; perl: 479; java: 447; objc: 291; makefile: 109
file content (170 lines) | stat: -rw-r--r-- 5,094 bytes parent folder | download | duplicates (5)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
NGCOMM
NGCOMM	$Id: LinuxLib,v 1.2 1997-05-20 16:00:28 boote Exp $
NGCOMM
NGCOMM###################################################################
NGCOMM#									#
NGCOMM#			      Copyright (C) 1997			#
NGCOMM#		University Corporation for Atmospheric Research		#
NGCOMM#			      All Rights Reserved			#
NGCOMM#									#
NGCOMM###################################################################
NGCOMM#
NGCOMM#	File:		LinuxLib
NGCOMM#
NGCOMM#	Author:		Jeff W. Boote
NGCOMM#			National Center for Atmospheric Research
NGCOMM#			PO 3000, Boulder, Colorado
NGCOMM#
NGCOMM#	Date:		Tue May 13 18:13:34 MDT 1997
NGCOMM#
NGCOMM#	Description:	Rules for building Shared libs for Linux
NGCOMM#

/*
 * Macro:	BuildSharedPartialFromArch
 *
 * Description:	Build a shared lib that should only be linked from
 *		another shared lib - it may have unresolved references.
 */
#ifndef	BuildSharedPartialFromArch
#define	BuildSharedPartialFromArch(library,arch,major,minor,reqlibs)\
]\
all::]\
]\
all-local:: library.so]\
]\
library.so:: library.so.major]\
	@$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
library.so.major:: arch]\
	MakeDir($(TOP)/shared)]\
	gcc -shared -o $@ $(EXTRA_LDFLAGS)  -Wl,-soname,library.so.major  -Wl,--whole-archive arch  -Wl,--no-whole-archive $(SHAREDLDLIBSEARCH)  -Wl,--as-needed  reqlibs -lgfortran ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so.major; \ ]\
	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\
]\
InstallTarget(library.so.major,$(INSTALL_LIB),$(LIBPATH))\
install-local:: library.so.major]\
	MakeDir($(LIBPATH))]\
	@cd $(LIBPATH); \ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
CleanFilesTarget(library.so library.so.major arch)
#endif	/* BuildSharedPartialFromArch */

/*
 * Macro:	BuildSharedFromArch
 *
 * Description:	Build a shared library from a .a file
 */
#ifndef	BuildSharedFromArch
#define	BuildSharedFromArch(library,arch,major,minor,reqlibs)\
]\
all::]\
]\
all-local:: library.so]\
]\
library.so:: library.so.major]\
	@$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
library.so.major:: arch]\
	MakeDir($(TOP)/shared)]\
	gcc -shared -o $@ $(EXTRA_LDFLAGS)  -Wl,-soname,library.so.major  -Wl,--whole-archive arch  -Wl,--no-whole-archive $(SHAREDLDLIBSEARCH) -Wl,--as-needed reqlibs  -lgfortran ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so.major; \ ]\
	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\
]\
InstallTarget(library.so.major,$(INSTALL_LIB),$(LIBPATH))\
install-local:: library.so.major]\
	MakeDir($(LIBPATH))]\
	@cd $(LIBPATH); \ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
CleanFilesTarget(library.so library.so.major arch)
#endif	/* BuildSharedFromArch */

/*
 * Macro:	BuildSharedPartialLib
 *
 * Description: Build a shared library that may contain unresolved references.
 *		It should not be linked in directly from users - this should
 *		only be used by other libraries, and it should contain
 *		ABSOLUTELY NO USER ENTRY POINTS - it should be created
 *		default - delay loaded.
 */
#ifndef	BuildSharedPartialLib
#define	BuildSharedPartialLib(library,objects,major,minor,reqlibs)\
]\
all::]\
]\
all-local:: library.so]\
]\
library.so:: library.so.major]\
	@$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
library.so.major:: objects]\
	MakeDir($(TOP)/shared)]\
	gcc -shared -o $@ $(EXTRA_LDFLAGS) -Wl,-soname,library.so.major objects $(SHAREDLDLIBSEARCH) -Wl,--as-needed reqlibs -lgfortran ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so.major; \ ]\
	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\
]\
InstallTarget(library.so.major,$(INSTALL_LIB),$(LIBPATH))\
install-local:: library.so.major]\
	MakeDir($(LIBPATH))]\
	@cd $(LIBPATH); \ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
CleanFilesTarget(library.so library.so.major)
#endif	/* BuildSharedPartialLib */

/*
 * Macro:	BuildSharedLibTarget
 *
 * Description: Build a shared library
 */
#ifndef	BuildSharedLibTarget
#define	BuildSharedLibTarget(library,objects,major,minor,reqlibs)\
]\
all::]\
]\
all-local:: library.so]\
]\
library.so:: library.so.major]\
	@$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
library.so.major:: objects]\
	MakeDir($(TOP)/shared)]\
	gcc -shared -o $@ objects $(EXTRA_LDFLAGS)  -Wl,-soname,library.so.major  $(SHAREDLIBSEARCH) $(_LIBROOTSEARCH) $(LIB_SEARCH) -Wl,--as-needed reqlibs -lgfortran ]\
	@cd $(TOP)/shared;\ ]\
	$(RM) library.so.major; \ ]\
	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\
]\
InstallTarget(library.so.major,$(INSTALL_LIB),$(LIBPATH))\
install-local:: library.so.major]\
	MakeDir($(LIBPATH))]\
	@cd $(LIBPATH); \ ]\
	$(RM) library.so; \ ]\
	$(LN) library.so.major library.so ]\
]\
CleanFilesTarget(library.so library.so.major)
#endif	/* BuildSharedLibTarget */