2 # Simple makefile for the sample loadable builtins
4 # Copyright (C) 1996-2009 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Include some boilerplate Gnu makefile definitions.
23 exec_prefix = @
exec_prefix@
27 includedir = @
includedir@
29 datarootdir
= @datarootdir@
32 BUILD_DIR
= @BUILD_DIR@
44 host_vendor
= @host_vendor@
47 LOCAL_CFLAGS
= @LOCAL_CFLAGS@
49 LOCAL_DEFS
= @LOCAL_DEFS@
53 BASHINCDIR
= ${topdir}/include
55 LIBBUILD
= ${BUILD_DIR}/lib
57 INTL_LIBSRC
= ${topdir}/lib
/intl
58 INTL_BUILDDIR
= ${LIBBUILD}/intl
60 LIBINTL_H
= @LIBINTL_H@
62 CCFLAGS
= $(DEFS
) $(LOCAL_DEFS
) $(LOCAL_CFLAGS
) $(CFLAGS
)
65 # These values are generated for configure by ${topdir}/support/shobj-conf.
66 # If your system is not supported by that script, but includes facilities for
67 # dynamic loading of shared objects, please update the script and send the
68 # changes to bash-maintainers@gnu.org.
71 SHOBJ_CFLAGS
= @SHOBJ_CFLAGS@
73 SHOBJ_LDFLAGS
= @SHOBJ_LDFLAGS@ @LDFLAGS@
74 SHOBJ_XLDFLAGS
= @SHOBJ_XLDFLAGS@
75 SHOBJ_LIBS
= @SHOBJ_LIBS@
76 SHOBJ_STATUS
= @SHOBJ_STATUS@
78 INC
= -I.
-I..
-I
$(topdir
) -I
$(topdir
)/lib
-I
$(topdir
)/builtins \
79 -I
$(BASHINCDIR
) -I
$(BUILD_DIR
) -I
$(LIBBUILD
) \
80 -I
$(BUILD_DIR
)/builtins
$(INTL_INC
)
83 $(SHOBJ_CC
) $(SHOBJ_CFLAGS
) $(CCFLAGS
) $(INC
) -c
-o
$@
$<
86 ALLPROG
= print truefalse sleep pushd finfo logname
basename dirname \
87 tty pathchk tee head mkdir rmdir printenv id whoami \
88 uname sync push ln unlink cut realpath getconf strftime mypid
89 OTHERPROG
= necho hello cat
97 @echo
"Your system (${host_os}) is not supported by the"
98 @echo
"${topdir}/support/shobj-conf script."
99 @echo
"If your operating system provides facilities for dynamic"
100 @echo
"loading of shared objects using the dlopen(3) interface,"
101 @echo
"please update the script and re-run configure.
102 @echo "Please send the changes you made to bash-maintainers@gnu.org
"
103 @echo "for inclusion in future bash releases.
"
105 everything: supported others
108 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ print.o $(SHOBJ_LIBS)
111 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ necho.o $(SHOBJ_LIBS)
114 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ getconf.o $(SHOBJ_LIBS)
117 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ hello.o $(SHOBJ_LIBS)
119 truefalse: truefalse.o
120 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ truefalse.o $(SHOBJ_LIBS)
123 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sleep.o $(SHOBJ_LIBS)
126 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ finfo.o $(SHOBJ_LIBS)
129 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cat.o $(SHOBJ_LIBS)
132 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -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AGS) -o $@ push.o $(SHOBJ_LIBS)
177 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ ln.o $(SHOBJ_LIBS)
180 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ unlink.o $(SHOBJ_LIBS)
183 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cut.o $(SHOBJ_LIBS)
186 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ realpath.o $(SHOBJ_LIBS)
189 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ strftime.o $(SHOBJ_LIBS)
192 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ mypid.o $(SHOBJ_LIBS)
194 # pushd is a special case. We use the same source that the builtin version
195 # uses, with special compilation options.
197 pushd.c: ${topdir}/builtins/pushd.def
199 ${BUILD_DIR}/builtins/mkbuiltins -D ${topdir}/builtins ${topdir}/builtins/pushd.def
203 $(SHOBJ_CC) -DHAVE_CONFIG_H -DPUSHD_AND_POPD -DLOADABLE_BUILTIN $(SHOBJ_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(INC) -c -o $@ $<
206 $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ pushd.o $(SHOBJ_LIBS)
209 $(RM) $(ALLPROG) $(OTHERPROG) *.o
210 -( cd perl && ${MAKE} ${MFLAGS} $@ )
213 -( cd perl && ${MAKE} ${MFLAGS} $@ )
215 distclean maintainer-clean: clean
216 $(RM) Makefile pushd.c
217 -( cd perl && ${MAKE} ${MFLAGS} $@ )
220 truefalse.o: truefalse.c
224 basename.o: basename.c
235 printenv.o: printenv.c
242 realpath.o: realpath.c
243 strftime.o: strftime.c