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":
29 INCLUDES = -I../include -I$(top_srcdir)/include
30 override CPPFLAGS += $(INCLUDES)
34 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
35 LIBTOOL_LINK = $(LIBTOOL) --mode=link
36 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
37 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
46 # Libtool's library interface versions:
47 CL_CURRENT = @CL_CURRENT@
48 CL_REVISION = @CL_REVISION@
51 # Programs used by "make install":
53 INSTALL_PROGRAM = @INSTALL_PROGRAM@
54 INSTALL_DATA = @INSTALL_DATA@
56 #### End of system configuration section. ####
60 # Needed by $(LIBTOOL).
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=.
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...
72 VPATH = $(aux_srcdir)/$(SUBDIR)
74 # Add subdirectory specific flags.
75 include $(srcdir)/$(SUBDIR)/Makeflags
76 override CPPFLAGS += $(SUBDIR_INCLUDES)
78 # Need to know the system name.
79 SYSTEM := $(shell uname -s)
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))
86 FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))
88 FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))
90 FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))
92 ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))
94 ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))
96 OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)
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))
105 SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
106 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))
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)
117 all : $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
119 all : $(OBJECTS_LO) $(SUBDIRS_TARGET)
122 alls : $(FILES_S) $(ASMFILES_S)
124 allo : $(FILES_LO) $(ASMFILES_LO)
126 ASMFLAGS := @ASMFLAGS@
127 ifeq (@AS_UNDERSCORE@,true)
128 ASMFLAGS += -DUNDERSCORE
131 # Rules for normal compilation.
134 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
137 $(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
139 # Rules for normal compilation, only needed for debugging.
142 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
145 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@
147 # Rules for preprocessing.
150 $(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
153 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@
155 # Rules for assembly language files,
157 ifneq ($(ASMFILES_LO),)
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' > $@
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' > $@
168 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
171 ifeq (@host_cpu@,hppa)
172 $(ASMFILES_S) : %.s : %.cc
173 -$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
175 $(ASMFILES_S) : %.s : %.cc
176 $(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
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 $<
188 $(ASMFILES_LO) : %.lo : %.s
189 $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(ASMFLAGS) $(TARGET_ARCH) -c $<
195 # Recurse into subdirectories
196 $(SUBDIRS_TARGET) : %.target : %.dirdep
199 $(SUBDIRS_DIRDEP) : %.dirdep :
204 $(ALLOBJECTS_LO) : $(SUBDIRS_TARGET)
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
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
218 $(MKDIR) $(DESTDIR)$(libdir)
219 $(MKDIR) $(DESTDIR)$(includedir)/cln
222 $(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(libdir)/libcln.la
223 $(RM) -r $(DESTDIR)$(includedir)/cln
230 $(RM) *.s *.o *.lo *.a *.la *.objectlist core
234 $(RM) config.status config.log config.cache Makefile
236 maintainer-clean : distclean