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