Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1 | # |
| 2 | # Makefile for lib/ss |
| 3 | # |
| 4 | |
| 5 | srcdir = @srcdir@ |
| 6 | top_srcdir = @top_srcdir@ |
| 7 | VPATH = @srcdir@ |
| 8 | top_builddir = ../.. |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 9 | my_dir = lib/ss |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 10 | INSTALL = @INSTALL@ |
| 11 | |
| 12 | @MCONFIG@ |
| 13 | |
| 14 | LIBRARY= libss |
| 15 | LIBDIR= ss |
| 16 | |
| 17 | DLL_ADDRESS = 0x66880000 |
| 18 | DLL_JUMPSIZE = 0x1000 |
| 19 | DLL_GOTSIZE = 0x1000 |
| 20 | DLL_VERSION = 1.0 |
| 21 | DLL_IMAGE = libss |
| 22 | DLL_STUB = libss |
| 23 | DLL_LIBS = -L../.. -lcom_err |
| 24 | DLL_MYDIR = ss |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 25 | DLL_INSTALL_DIR = $(root_libdir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 26 | |
| 27 | ELF_VERSION = 2.0 |
Theodore Ts'o | 297f47a | 1997-04-26 14:25:20 +0000 | [diff] [blame] | 28 | ELF_SO_VERSION = 2 |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 29 | ELF_IMAGE = libss |
| 30 | ELF_MYDIR = ss |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 31 | ELF_INSTALL_DIR = $(root_libdir) |
Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 32 | ELF_OTHER_LIBS = -lc -L../.. -lcom_err |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 33 | |
| 34 | BSDLIB_VERSION = 1.0 |
| 35 | BSDLIB_IMAGE = libss |
| 36 | BSDLIB_MYDIR = ss |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 37 | BSDLIB_INSTALL_DIR = $(root_libdir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 38 | |
| 39 | TAGS=etags |
| 40 | COMPILE_ET=../et/compile_et |
Theodore Ts'o | 1f00aaf | 2000-07-04 12:34:34 +0000 | [diff] [blame^] | 41 | MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 42 | |
| 43 | # -I.. is so that ss/ss_err.h works |
| 44 | # -I$(srcdir)/.. is so that ss/ss.h works |
| 45 | # -I$(srcdir)/../et is so com_err.h works |
| 46 | XTRA_CFLAGS=-DPOSIX_SIGNALS -I$(srcdir)/../et |
| 47 | |
| 48 | .c.o: |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 49 | $(CC) $(ALL_CFLAGS) -c $< |
Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 50 | @PROFILE_CMT@ $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $< |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 51 | @CHECKER_CMT@ $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $< |
| 52 | @DLL_CMT@ (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) \ |
| 53 | @DLL_CMT@ $(ALL_CFLAGS) -o jump/$*.o -c $<) |
| 54 | @ELF_CMT@ $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $< |
| 55 | @BSDLIB_CMT@ $(CC) $(ALL_CFLAGS) -fpic -o pic/$*.o -c $< |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 56 | |
| 57 | # for the library |
| 58 | |
| 59 | LIB= libss.a |
| 60 | |
| 61 | # with ss_err.o first, ss_err.h should get rebuilt first too. should not |
| 62 | # be relying on this, though. |
| 63 | OBJS= ss_err.o \ |
| 64 | std_rqs.o \ |
| 65 | invocation.o help.o \ |
| 66 | execute_cmd.o listen.o parse.o error.o prompt.o \ |
| 67 | request_tbl.o list_rqs.o pager.o requests.o \ |
| 68 | data.o |
| 69 | |
| 70 | SRCS= $(srcdir)/invocation.c $(srcdir)/help.c \ |
| 71 | $(srcdir)/execute_cmd.c $(srcdir)/listen.c $(srcdir)/parse.c \ |
| 72 | $(srcdir)/error.c $(srcdir)/prompt.c $(srcdir)/request_tbl.c \ |
| 73 | $(srcdir)/list_rqs.c $(srcdir)/pager.c $(srcdir)/requests.c \ |
| 74 | $(srcdir)/data.c |
| 75 | |
| 76 | all:: mk_cmds |
| 77 | |
| 78 | @MAKEFILE_LIBRARY@ |
| 79 | @MAKEFILE_DLL@ |
| 80 | @MAKEFILE_ELF@ |
| 81 | @MAKEFILE_BSDLIB@ |
| 82 | @MAKEFILE_PROFILE@ |
| 83 | @MAKEFILE_CHECKER@ |
| 84 | |
| 85 | CODE= $(SRCS) $(MKCMDSFILES) |
| 86 | |
| 87 | MKCMDSOBJS= mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o |
| 88 | |
| 89 | MKCMDSFILES= mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l |
| 90 | |
| 91 | MKCMDSCSRCS= mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c |
| 92 | |
| 93 | |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 94 | HFILES= ss.h ss_internal.h |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 95 | SHARE_FILES= ct_c.awk ct_c.sed |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 96 | |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 97 | INSTALL_HFILES= ss.h |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 98 | |
| 99 | # for 'tags' and dependencies |
| 100 | |
| 101 | CFILES= $(SRCS) $(MKCMDSCSRCS) test_ss.c |
| 102 | |
| 103 | # for building archives |
| 104 | |
| 105 | FILES= $(SRCS) $(MKCMDSFILES) $(HFILES) \ |
| 106 | ss_err.et std_rqs.ct Makefile \ |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 107 | test_ss.c ss |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 108 | |
| 109 | all:: libss.a # libss_p.a lint |
| 110 | |
Theodore Ts'o | 1f00aaf | 2000-07-04 12:34:34 +0000 | [diff] [blame^] | 111 | std_rqs.c: std_rqs.ct mk_cmds |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 112 | DIR=$(srcdir) $(MK_CMDS) $(srcdir)/std_rqs.ct |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 113 | |
| 114 | ss_err.c ss_err.h: ss_err.et |
| 115 | $(COMPILE_ET) $(srcdir)/ss_err.et |
| 116 | |
| 117 | ct.tab.c ct.tab.h: ct.y |
| 118 | $(RM) -f ct.tab.* y.* |
| 119 | $(YACC) -d $(srcdir)/ct.y |
| 120 | $(MV) -f y.tab.c ct.tab.c |
| 121 | $(MV) -f y.tab.h ct.tab.h |
| 122 | |
| 123 | #libss.o: $(OBJS) |
| 124 | # $(LD) -r -s -o $@ $(OBJS) |
| 125 | # $(CHMOD) -x $@ |
| 126 | |
Theodore Ts'o | 44339bd | 1997-10-15 02:47:20 +0000 | [diff] [blame] | 127 | mk_cmds: $(DEP_SUBSTITUTE) $(srcdir)/mk_cmds.sh.in |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 128 | $(SUBSTITUTE) $(srcdir)/mk_cmds.sh.in mk_cmds |
| 129 | $(CHMOD) +x mk_cmds |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 130 | |
| 131 | installdirs:: |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 132 | $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \ |
| 133 | $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \ |
| 134 | $(DESTDIR)$(bindir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 135 | |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 136 | install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 137 | $(INSTALL_DATA) libss.a $(DESTDIR)$(libdir)/libss.a |
| 138 | $(CHMOD) 644 $(DESTDIR)$(libdir)/libss.a |
| 139 | -$(RANLIB) $(DESTDIR)$(libdir)/libss.a |
| 140 | $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libss.a |
Theodore Ts'o | 7cf73dc | 1997-08-14 17:17:16 +0000 | [diff] [blame] | 141 | $(RM) -f $(DESTDIR)$(includedir)/ss/* |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 142 | for i in $(INSTALL_HFILES); do \ |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 143 | $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \ |
| 144 | done |
Theodore Ts'o | 5972d0d | 1997-06-07 03:45:08 +0000 | [diff] [blame] | 145 | $(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 146 | for i in $(SHARE_FILES); do \ |
| 147 | $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/ss/$$i; \ |
| 148 | done |
| 149 | $(INSTALL) mk_cmds $(DESTDIR)$(bindir)/mk_cmds |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 150 | |
| 151 | uninstall:: |
Theodore Ts'o | e5fa0e3 | 1998-04-01 02:18:45 +0000 | [diff] [blame] | 152 | $(RM) -f $(DESTDIR)$(libdir)/libss.a $(DESTDIR)$(bindir)/mk_cmds |
| 153 | $(RM) -rf $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 154 | |
| 155 | clean:: |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 156 | $(RM) -f ../libss.a libss.a mk_cmds ss_err.h ss_err.c std_rqs.c \ |
| 157 | *.o *~ \#* *.bak core |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 158 | |
| 159 | mostlyclean:: clean |
| 160 | distclean:: clean |
Theodore Ts'o | 5c36a2f | 1999-11-19 18:42:30 +0000 | [diff] [blame] | 161 | $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 162 | |
Theodore Ts'o | f0f4acb | 2000-05-25 23:22:11 +0000 | [diff] [blame] | 163 | # |
| 164 | # Hack to parallel makes recognize dependencies correctly. |
| 165 | # |
| 166 | $(top_builddir)/lib/ss/ss_err.h: ss_err.h |
| 167 | |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 168 | # +++ Dependency line eater +++ |
| 169 | # |
| 170 | # Makefile dependencies follow. This must be the last section in |
| 171 | # the Makefile.in file |
| 172 | # |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 173 | invocation.o: $(srcdir)/invocation.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 174 | $(top_builddir)/lib/ss/ss_err.h |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 175 | help.o: $(srcdir)/help.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 176 | $(top_builddir)/lib/ss/ss_err.h |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 177 | execute_cmd.o: $(srcdir)/execute_cmd.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 178 | $(top_builddir)/lib/ss/ss_err.h |
| 179 | listen.o: $(srcdir)/listen.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
| 180 | $(top_builddir)/lib/ss/ss_err.h |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 181 | parse.o: $(srcdir)/parse.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 182 | $(top_builddir)/lib/ss/ss_err.h |
| 183 | error.o: $(srcdir)/error.c $(srcdir)/../et/com_err.h $(srcdir)/ss_internal.h \ |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 184 | $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 185 | prompt.o: $(srcdir)/prompt.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
| 186 | $(top_builddir)/lib/ss/ss_err.h |
| 187 | request_tbl.o: $(srcdir)/request_tbl.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
| 188 | $(top_builddir)/lib/ss/ss_err.h |
| 189 | list_rqs.o: $(srcdir)/list_rqs.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
| 190 | $(top_builddir)/lib/ss/ss_err.h |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 191 | pager.o: $(srcdir)/pager.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 192 | $(top_builddir)/lib/ss/ss_err.h |
| 193 | requests.o: $(srcdir)/requests.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
| 194 | $(top_builddir)/lib/ss/ss_err.h |
Theodore Ts'o | 62c06f7 | 1997-04-29 14:34:47 +0000 | [diff] [blame] | 195 | data.o: $(srcdir)/data.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \ |
Theodore Ts'o | 2740156 | 1999-09-14 20:11:19 +0000 | [diff] [blame] | 196 | $(top_builddir)/lib/ss/ss_err.h |