UnixReview.com
June 2006
Listing 2: makefile
# # Simple makefile for the sample loadable builtins # # Copyright (C) 1996 Free Software Foundation, Inc. # Modified 2006, Chris F.A. Johnson <[email protected]> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. # Include some boilerplate Gnu makefile definitions. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin libdir = ${exec_prefix}/lib infodir = ${prefix}/info includedir = ${prefix}/include ## The next line should point to your bash source tree BUILD_DIR = /home/chris/src/bash-3.1 topdir = ${BUILD_DIR} srcdir = . VPATH = . CC = gcc RM = rm -f SHELL = /bin/sh host_os = linux-gnuoldld host_cpu = i686 host_vendor = pc CFLAGS = -g -O2 LOCAL_CFLAGS = DEFS = -DHAVE_CONFIG_H LOCAL_DEFS = -DSHELL CPPFLAGS = BASHINCDIR = ${topdir}/include LIBBUILD = ${BUILD_DIR}/lib INTL_LIBSRC = ${topdir}/lib/intl INTL_BUILDDIR = ${LIBBUILD}/intl INTL_INC = LIBINTL_H = CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS) # # These values are generated for configure by ${topdir}/support/shobj-conf. # If your system is not supported by that script, but includes facilities for # dynamic loading of shared objects, please update the script and send the # changes to [email protected]. # SHOBJ_CC = gcc SHOBJ_CFLAGS = -fPIC SHOBJ_LD = ${CC} SHOBJ_LDFLAGS = -shared -Wl,-soname,$@ SHOBJ_XLDFLAGS = SHOBJ_LIBS = INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ -I$(BASHINCDIR) -I$(BUILD_DIR) -I$(LIBBUILD) \ -I$(BUILD_DIR)/builtins $(INTL_INC) .c.o: $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $< all: clean: $(RM) $(OTHERPROG) *.o