1# 2# Makefile for lib/et 3# 4 5srcdir = @srcdir@ 6top_srcdir = @top_srcdir@ 7VPATH = @srcdir@ 8top_builddir = ../.. 9my_dir = lib/et 10INSTALL = @INSTALL@ 11MKDIR_P = @MKDIR_P@ 12 13DEP_MAKEFILE = $(DEP_LIB_MAKEFILES) 14 15@MCONFIG@ 16 17all:: compile_et com_err.pc 18 19OBJS= error_message.o et_name.o init_et.o com_err.o com_right.o 20SRCS = $(srcdir)/error_message.c $(srcdir)/et_name.c $(srcdir)/init_et.c \ 21 $(srcdir)/com_err.c $(srcdir)/com_right.c 22 23HFILES= com_err.h 24SHARE_FILES= et_c.awk et_h.awk 25 26LIBRARY= libcom_err 27LIBDIR= et 28 29ELF_VERSION = 2.1 30ELF_SO_VERSION = 2 31ELF_IMAGE = libcom_err 32ELF_MYDIR = et 33ELF_INSTALL_DIR = $(root_libdir) 34ELF_OTHER_LIBS = @SEM_INIT_LIB@ 35 36BSDLIB_VERSION = 1.1 37BSDLIB_IMAGE = libcom_err 38BSDLIB_MYDIR = et 39BSDLIB_INSTALL_DIR = $(root_libdir) 40 41# 42# what to build... 43# 44.c.o: 45 $(E) " CC $<" 46 $(Q) $(CC) $(ALL_CFLAGS_STLIB) -c $< -o $@ 47 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $< 48 $(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $< 49@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS_STLIB) -g -pg -o profiled/$*.o -c $< 50@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) -fPIC -shared -o elfshared/$*.o -c $< 51@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $< 52 53@MAKEFILE_LIBRARY@ 54@MAKEFILE_ELF@ 55@MAKEFILE_BSDLIB@ 56@MAKEFILE_PROFILE@ 57 58compile_et: $(DEP_SUBSTITUTE) $(srcdir)/compile_et.sh.in 59 $(E) " SUBST $@" 60 $(Q) $(SUBSTITUTE) $(srcdir)/compile_et.sh.in compile_et 61 $(Q) $(CHMOD) +x compile_et 62 63DVI=texi2dvi 64DVIPS=dvips -o "$@" 65INFO=@MAKEINFO@ 66HTML=makeinfo --html --no-split 67PS2PDF=ps2pdf 68 69com_err.ps : com_err.dvi 70com_err.dvi: com_err.texinfo 71 72com_err.info: $(srcdir)/com_err.texinfo 73 $(E) " MAKEINFO $@" 74 -$(Q) $(INFO) $(srcdir)/com_err.texinfo 75 76com_err.dvi: $(srcdir)/com_err.texinfo 77 $(E) " TEXI2DVI $@" 78 -$(Q) $(DVI) $(srcdir)/com_err.texinfo 79 80com_err.ps: com_err.dvi 81 $(E) " DVIPS $@" 82 -$(Q) $(DVIPS) com_err.dvi 83 84com_err.pdf: com_err.ps 85 $(E) " PS2PDF $@" 86 -$(Q) $(PS2PDF) com_err.ps 87 88com_err.html: $(srcdir)/com_err.texinfo 89 $(E) " MAKEINFO $@" 90 -$(Q) $(HTML) $(srcdir)/com_err.texinfo 91 92com_err.pc: $(srcdir)/com_err.pc.in $(top_builddir)/config.status 93 $(E) " CONFIG.STATUS $@" 94 $(Q) cd $(top_builddir); CONFIG_FILES=lib/et/com_err.pc ./config.status 95 96#libcom_err.o: $(LIBOBJS) 97# $(LD) -r -s -o libcom_err.o $(LIBOBJS) 98# chmod -x libcom_err.o 99 100TAGS: $(SRCS) 101 $(TAGS) $(SRCS) 102 103installdirs:: 104 $(E) " MKDIR_P $(libdir) $(includedir)/et $(datadir)/et $(bindir) $(man1dir) $(man3dir)" 105 $(Q) $(MKDIR_P) $(DESTDIR)$(libdir) \ 106 $(DESTDIR)$(includedir)/et $(DESTDIR)$(datadir)/et \ 107 $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) \ 108 $(DESTDIR)$(man3dir) $(DESTDIR)$(pkgconfigdir) 109 110install:: compile_et libcom_err.a $(HFILES) installdirs com_err.pc 111 $(E) " INSTALL_DATA $(libdir)/libcom_err.a" 112 $(Q) $(INSTALL_DATA) libcom_err.a $(DESTDIR)$(libdir)/libcom_err.a 113 -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libcom_err.a 114 $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libcom_err.a 115 $(Q) for i in $(HFILES); do \ 116 echo " INSTALL_DATA $(includedir)/et/$$i"; \ 117 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/et/$$i; \ 118 done 119 $(Q) (cd $(DESTDIR)$(includedir) ;\ 120 $(LN) $(LINK_INSTALL_FLAGS) et/com_err.h . ) 121 $(Q) for i in $(SHARE_FILES); do \ 122 echo " INSTALL_DATA $(datadir)/et/$$i"; \ 123 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/et/$$i; \ 124 done 125 $(E) " INSTALL_SCRIPT $(bindir)/compile_et" 126 $(Q) $(INSTALL_SCRIPT) compile_et $(DESTDIR)$(bindir)/compile_et 127 $(E) " INSTALL_DATA $(man3dir)/com_err.3" 128 $(Q) $(INSTALL_DATA) $(srcdir)/com_err.3 $(DESTDIR)$(man3dir)/com_err.3 129 $(E) " INSTALL_DATA $(man1dir)/compile_et.1" 130 $(Q) $(INSTALL_DATA) $(srcdir)/compile_et.1 \ 131 $(DESTDIR)$(man1dir)/compile_et.1 132 $(E) " INSTALL_DATA $(pkgconfigdir)/com_err.pc" 133 $(Q) $(INSTALL_DATA) com_err.pc $(DESTDIR)$(pkgconfigdir)/com_err.pc 134 135uninstall:: 136 $(RM) -f $(DESTDIR)$(libdir)/libcom_err.a \ 137 $(DESTDIR)$(bindir)/compile_et \ 138 $(DESTDIR)$(pkgconfigdir)/com_err.pc 139 $(RM) -rf $(DESTDIR)$(includedir)/et $(DESTDIR)$(datadir)/et 140 141fullcheck check:: compile_et 142 for i in $(srcdir)/test_cases/*.et ; do \ 143 t=`basename $$i | sed -e 's/.et//'`; \ 144 _ET_DIR_OVERRIDE=$(srcdir) ./compile_et $$i ; \ 145 diff -c $(srcdir)/test_cases/$$t.c $$t.c > $$t.failed; \ 146 if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \ 147 diff -c $(srcdir)/test_cases/$$t.h $$t.h >> $$t.failed; \ 148 if [ $$? -ne 0 ]; then echo Test case $$t failed; exit 1 ; fi ; \ 149 $(RM) -f $$t.c $$t.h $$t.failed; \ 150 echo "Test case $$t succeeded" ; \ 151 done 152 153clean:: 154 $(RM) -f compile_et libcom_err.a libcom_err_p.a com_err.info 155 $(RM) -f $(OBJS) profiled/* 156 $(RM) -f *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.ps TAGS *.ln \ 157 *.html *.cp *.fn *.fns *.ky *.log *.pc *.pg *.toc *.tp *.vr \ 158 *.pdf 159 $(RM) -f ../libcom_err.a ../libcom_err_p.a 160 161mostlyclean:: clean 162distclean:: clean 163 $(RM) -f .depend Makefile com_err.pc \ 164 $(srcdir)/TAGS $(srcdir)/Makefile.in.old 165 166$(OBJS): subdirs 167 168# +++ Dependency line eater +++ 169# 170# Makefile dependencies follow. This must be the last section in 171# the Makefile.in file 172# 173error_message.o: $(srcdir)/error_message.c $(top_builddir)/lib/config.h \ 174 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \ 175 $(srcdir)/internal.h 176et_name.o: $(srcdir)/et_name.c $(top_builddir)/lib/config.h \ 177 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \ 178 $(srcdir)/internal.h 179init_et.o: $(srcdir)/init_et.c $(top_builddir)/lib/config.h \ 180 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h 181com_err.o: $(srcdir)/com_err.c $(top_builddir)/lib/config.h \ 182 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h \ 183 $(srcdir)/internal.h 184com_right.o: $(srcdir)/com_right.c $(top_builddir)/lib/config.h \ 185 $(top_builddir)/lib/dirpaths.h $(srcdir)/com_err.h $(srcdir)/error_table.h 186