Whamcloud - gitweb
76f2672fa418a983bcb6153acd85dae0b83c3e28
[tools/e2fsprogs.git] / lib / ss / Makefile.in
1 #
2 # Makefile for lib/ss
3 #
4
5 srcdir = @srcdir@
6 top_srcdir = @top_srcdir@
7 VPATH = @srcdir@
8 top_builddir = ../..
9 my_dir = lib/ss
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
25 DLL_INSTALL_DIR = $(root_libdir)
26
27 ELF_VERSION = 2.0
28 ELF_SO_VERSION = 2
29 ELF_IMAGE = libss
30 ELF_MYDIR = ss
31 ELF_INSTALL_DIR = $(root_libdir)
32 ELF_OTHER_LIBS = -L../.. -lcom_err
33
34 BSDLIB_VERSION = 1.0
35 BSDLIB_IMAGE = libss
36 BSDLIB_MYDIR = ss
37 BSDLIB_INSTALL_DIR = $(root_libdir)
38
39 TAGS=etags
40 COMPILE_ET=../et/compile_et
41 MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
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:
49         $(CC) $(ALL_CFLAGS) -c $<
50 @PROFILE_CMT@   $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
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 $<
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
94 HFILES= ss.h ss_internal.h
95 SHARE_FILES= ct_c.awk ct_c.sed
96
97 INSTALL_HFILES= ss.h 
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 \
107         test_ss.c ss 
108
109 all::   libss.a # libss_p.a lint
110
111 std_rqs.c: std_rqs.ct mk_cmds
112         DIR=$(srcdir) $(MK_CMDS) $(srcdir)/std_rqs.ct
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
127 mk_cmds: $(DEP_SUBSTITUTE) $(srcdir)/mk_cmds.sh.in
128         $(SUBSTITUTE) $(srcdir)/mk_cmds.sh.in mk_cmds
129         $(CHMOD) +x mk_cmds
130
131 installdirs::
132         $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
133                 $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \
134                 $(DESTDIR)$(bindir)
135
136 install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds
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
141         $(RM) -f $(DESTDIR)$(includedir)/ss/*
142         for i in $(INSTALL_HFILES); do \
143                 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
144         done
145         $(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h
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
150
151 uninstall::
152         $(RM) -f $(DESTDIR)$(libdir)/libss.a $(DESTDIR)$(bindir)/mk_cmds
153         $(RM) -rf $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss
154
155 clean::
156         $(RM) -f ../libss.a libss.a mk_cmds ss_err.h ss_err.c std_rqs.c \
157                 *.o *~ \#* *.bak core 
158
159 mostlyclean:: clean
160 distclean:: clean
161         $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
162
163 #
164 # Hack to parallel makes recognize dependencies correctly.
165 #
166 $(top_builddir)/lib/ss/ss_err.h: ss_err.h
167
168 # +++ Dependency line eater +++
169
170 # Makefile dependencies follow.  This must be the last section in
171 # the Makefile.in file
172 #
173 invocation.o: $(srcdir)/invocation.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
174  $(top_builddir)/lib/ss/ss_err.h
175 help.o: $(srcdir)/help.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
176  $(top_builddir)/lib/ss/ss_err.h
177 execute_cmd.o: $(srcdir)/execute_cmd.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
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
181 parse.o: $(srcdir)/parse.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
182  $(top_builddir)/lib/ss/ss_err.h
183 error.o: $(srcdir)/error.c $(srcdir)/../et/com_err.h $(srcdir)/ss_internal.h \
184  $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
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
191 pager.o: $(srcdir)/pager.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
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
195 data.o: $(srcdir)/data.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
196  $(top_builddir)/lib/ss/ss_err.h