3 #### Start of system configuration section. ####
5 # Directories used by "make":
7 top_srcdir = @top_srcdir@
9 # Directories used by "make install":
11 local_prefix = /usr/local
12 exec_prefix = @exec_prefix@
15 includedir = @includedir@
19 # Programs used by "make":
28 INCLUDES = -I../include -I$(top_srcdir)/include
29 override CPPFLAGS += $(INCLUDES)
32 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
33 LIBTOOL_LINK = $(LIBTOOL) --mode=link
34 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
35 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
44 # Libtool's library interface versions:
45 CL_CURRENT = @CL_CURRENT@
46 CL_REVISION = @CL_REVISION@
49 # Programs used by "make install":
51 INSTALL_PROGRAM = @INSTALL_PROGRAM@
52 INSTALL_DATA = @INSTALL_DATA@
54 #### End of system configuration section. ####
58 # Needed by $(LIBTOOL).
61 # When this Makefile is called with SUBDIR=some_subdirectory, it builds
62 # only the object files belonging to sources in that subdirectory. The
63 # final library is built only if SUBDIR=.
66 # Define the search path for sources.
67 # The variable $(aux_srcdir) is needed because new versions of aufoconf tend to
68 # remove $(srcdir), ${srcdir} and so on...
70 VPATH = $(aux_srcdir)/$(SUBDIR)
72 # Add subdirectory specific flags.
73 include $(srcdir)/$(SUBDIR)/Makeflags
74 override CPPFLAGS += $(SUBDIR_INCLUDES)
76 # Need to know the system name.
77 SYSTEM := $(shell uname -s)
79 FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
80 FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
81 ASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(FILES_CC)))
82 FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))
84 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
86 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
88 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
90 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
92 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
94 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
96 SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
97 # Avoid certain subdirectories:
98 # private/ and old/ don't contain valid sources,
99 # CVS/ and RCS/ are created when people put the sources under version control,
100 # ii_files/ is created during "make" by SGI C++.
101 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS ii_files ./ii_files,$(SUBDIRS))
103 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
104 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
107 ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
108 ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
109 ALLASMFILES_CC := $(patsubst cl_asm_@host_cpu@_%.cc,cl_asm_%.cc, $(filter cl_asm_@host_cpu@_%.cc, $(ALLFILES_CC)))
110 ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
111 ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
112 ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
113 ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)
115 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
117 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
120 alls : $(FILES_S) $(ASMFILES_S)
122 allo : $(FILES_LO) $(ASMFILES_LO)
125 ifeq (@AS_UNDERSCORE@,true)
126 ASMFLAGS += -DUNDERSCORE
129 # Rules for normal compilation.
132 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
135 $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
137 # Rules for normal compilation, only needed for debugging.
140 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
143 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
145 # Rules for preprocessing.
148 $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
151 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
153 # Rules for assembly language files,
155 ifneq ($(ASMFILES_LO),)
157 ifneq ($(filter @host_cpu@,sparc sparc64),)
158 $(ASMFILES_S) : %.s : %.cc
159 $(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' > $@
161 ifeq (@host_cpu@,m68k)
162 $(ASMFILES_S) : %.s : %.cc
163 ifeq (@AS_UNDERSCORE@,true)
164 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
166 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
169 ifeq (@host_cpu@,hppa)
170 $(ASMFILES_S) : %.s : %.cc
171 -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
173 $(ASMFILES_S) : %.s : %.cc
174 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
179 ifeq (@host_cpu@,hppa)
180 # Only the native as groks the .SHORTDATA statements
181 $(ASMFILES_LO) : %.lo : %.s
182 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
183 || COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
184 || COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
186 $(ASMFILES_LO) : %.lo : %.s
187 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
193 # Recurse into subdirectories
194 $(SUBDIRS_TARGET) : %.target : %.dirdep
197 $(SUBDIRS_DIRDEP) : %.dirdep :
202 libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO)
203 $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) -version-info $(CL_CURRENT):$(CL_REVISION):$(CL_AGE) $(LDFLAGS) $(LIBS) $(ALLOBJECTS_LO)
206 $(MKDIR) $(DESTDIR)$(libdir)
207 $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcln.la $(DESTDIR)$(libdir)/libcln.la
208 $(MKDIR) $(DESTDIR)$(includedir)/cln
209 $(INSTALL_DATA) $(top_srcdir)/include/cln/*.h $(DESTDIR)$(includedir)/cln
210 $(INSTALL_DATA) ../include/cln/*.h $(DESTDIR)$(includedir)/cln
213 $(MKDIR) $(DESTDIR)$(libdir)
214 $(MKDIR) $(DESTDIR)$(includedir)/cln
217 $(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(libdir)/libcln.la
218 $(RM) -r $(DESTDIR)$(includedir)/cln
225 $(RM) *.s *.o *.lo *.a *.la core
229 $(RM) config.status config.log config.cache Makefile
231 maintainer-clean : distclean