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