]> www.ginac.de Git - cln.git/blob - src/Makefile.in
2257a7c4515e1f9a9df50bc2211aa3c1165e9498
[cln.git] / src / Makefile.in
1 # Makefile for cln/src
2
3 #### Start of system configuration section. ####
4
5 # Directories used by "make":
6 srcdir = @srcdir@
7 top_srcdir = @top_srcdir@
8
9 # Directories used by "make install":
10 prefix = @prefix@
11 local_prefix = /usr/local
12 exec_prefix = @exec_prefix@
13 datadir = @datadir@
14 libdir = @libdir@
15 includedir = @includedir@
16 mandir = @mandir@
17
18 # Programs used by "make":
19 # C compiler
20 CC = @CC@
21 CFLAGS = @CFLAGS@
22 CPP = @CPP@
23 # C++ compiler
24 CXX = @CXX@
25 CXXFLAGS = @CXXFLAGS@
26 CXXCPP = @CXXCPP@
27 INCLUDES = -I../include -I$(top_srcdir)/include
28 CPPFLAGS += $(INCLUDES)
29 LIBTOOL = @LIBTOOL@
30 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
31 LIBTOOL_LINK = $(LIBTOOL) --mode=link
32 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
33 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
34 AR = ar
35 AR_FLAGS = rc
36 RANLIB = @RANLIB@
37 MV = mv
38 LN = ln
39 RM = rm -f
40 @SET_MAKE@
41
42 # Programs used by "make install":
43 INSTALL = @INSTALL@
44 INSTALL_PROGRAM = @INSTALL_PROGRAM@
45 INSTALL_DATA = @INSTALL_DATA@
46
47 #### End of system configuration section. ####
48
49 SHELL = /bin/sh
50
51 # Needed by $(LIBTOOL).
52 top_builddir = ..
53
54 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
55 # only the object files belonging to sources in that subdirectory. The
56 # final library is built only if SUBDIR=.
57 SUBDIR = .
58
59 # Define the search path for sources.
60 # The ":" below keeps config.status from removing this line.
61 VPATH = $(srcdir)/$(SUBDIR) # :
62
63 # Add subdirectory specific flags.
64 include $(srcdir)/$(SUBDIR)/Makeflags
65 CPPFLAGS += $(SUBDIR_INCLUDES)
66
67 # Need to know the system name.
68 SYSTEM := $(shell uname -s)
69
70 FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
71 FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
72 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(FILES_CC)))
73 FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))
74
75 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
76
77 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
78
79 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
80
81 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
82
83 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
84
85 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
86
87 SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
88 # Avoid certain subdirectories:
89 #   private/ and old/ don't contain valid sources,
90 #   CVS/ and RCS/ are created when people put the sources under version control,
91 #   ii_files/ is created during "make" by SGI C++.
92 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS ii_files ./ii_files,$(SUBDIRS))
93
94 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
95 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
96
97 ifeq ($(SUBDIR),.)
98 ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
99 ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
100 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(ALLFILES_CC)))
101 ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
102 ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
103 ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
104 ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)
105
106 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
107 else
108 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
109 endif
110
111 alls : $(FILES_S) $(ASMFILES_S)
112
113 allo : $(FILES_LO) $(ASMFILES_LO)
114
115 ASMFLAGS :=
116 ifeq (@AS_UNDERSCORE@,true)
117 ASMFLAGS += -DUNDERSCORE
118 endif
119
120 # Rules for normal compilation.
121
122 %.lo : %.c
123         $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
124
125 %.lo : %.cc
126         $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
127
128 # Rules for normal compilation, only needed for debugging.
129
130 %.s : %.c
131         $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
132
133 %.s : %.cc
134         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
135
136 # Rules for preprocessing.
137
138 %.i : %.c
139         $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
140
141 %.i.cc : %.cc
142         $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
143
144 # Rules for assembly language files,
145
146 ifneq ($(ASMFILES_LO),)
147
148 ifneq ($(filter @host_cpu@,sparc sparc64),)
149 $(ASMFILES_S) : %.s : %.cc
150         $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(ASMFLAGS) $< | grep -v '^#' | grep -v '^ *#line' | sed -e 's/\([.%]\) /\1/g' -e 's/ , /,/g' -e 's/ :/:/g' -e 's/\$$/#/g' > $@
151 else
152 ifeq (@host_cpu@,m68k)
153 $(ASMFILES_S) : %.s : %.cc
154 ifeq (@AS_UNDERSCORE@,true)
155         $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
156 else
157         $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
158 endif
159 else
160 ifeq (@host_cpu@,hppa)
161 $(ASMFILES_S) : %.s : %.cc
162         -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
163 else
164 $(ASMFILES_S) : %.s : %.cc
165         $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
166 endif
167 endif
168 endif
169
170 ifeq (@host_cpu@,hppa)
171 # Only the native as groks the .SHORTDATA statements
172 $(ASMFILES_LO) : %.lo : %.s
173         $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
174         || COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
175         || COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
176 else
177 $(ASMFILES_LO) : %.lo : %.s
178         $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
179 endif
180
181 endif
182
183
184 # Recurse into subdirectories
185 $(SUBDIRS_TARGET) : %.target : %.dirdep
186         $(MAKE) SUBDIR=$*
187
188 $(SUBDIRS_DIRDEP) : %.dirdep :
189
190
191 ifeq ($(SUBDIR),.)
192
193 ../gmp/mpn/libmpn.la : $(LIBTOOL)
194         cd ../gmp && $(MAKE) mpn/libmpn.la mp_clz_tab.lo
195
196
197 libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO)
198         $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) $(ALLOBJECTS_LO)
199
200 install : all force
201         if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
202         $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcln.la $(libdir)/libcln.la
203         if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
204         $(INSTALL_DATA) $(top_srcdir)/include/*.h $(includedir)
205         $(INSTALL_DATA) ../include/*.h $(includedir)
206 #       if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
207 #       if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
208 #       if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
209 #       if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi
210
211 installdirs : force
212         if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
213         if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
214 #       if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
215 #       if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
216 #       if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
217 #       if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi
218
219 uninstall : force
220         $(LIBTOOL_UNINSTALL) $(RM) $(libdir)/libcln.la
221         $(RM) $(addprefix $(includedir)/, $(notdir $(wildcard $(top_srcdir)/include/*.h)))
222         $(RM) $(addprefix $(includedir)/, $(notdir $(wildcard ../include/*.h)))
223
224 check : all
225
226 mostlyclean : clean
227
228 clean : force
229         $(RM) *.s *.o *.lo *.a *.la core
230         $(RM) -r .libs _libs
231
232 distclean : clean
233         $(RM) config.status config.log config.cache Makefile
234
235 maintainer-clean : distclean
236
237 endif
238
239 force :