2 # Simple makefile for the sample loadable builtins
4 # This includes some boilerplate definitions added by configure, but will
5 # still need hand-editing
7 # Include some boilerplate Gnu makefile definitions.
10 exec_prefix = @exec_prefix@
14 includedir = @includedir@
17 BUILD_DIR = @BUILD_DIR@
29 # Some versions of gcc, esp. on NetBSD and FreeBSD
31 # Linux -- could also be -fpic
37 # BSD/OS 2.1, BSD/OS 3.x
42 # SunOS 4, BSD/OS 2.1, BSD/OS 3.x, SVR4.2, SVR4, Linux, AIX 4.2, etc.
48 #LDOPT = -assert pure-text
50 #LDOPT = -shared -soname $@ -expect_unresolved '*'
51 # SunOS 5 using sun cc
52 #LDOPT = -dy -z text -G -i -h $@
53 # SunOS 5 using gcc with Sun ld
54 #LDOPT = -shared -Wl,-dy -Wl,-G -Wl,-i
56 #LDOPT = -dy -z text -G -h $@
57 # NetBSD, FreeBSD -- might also need -r
58 LDOPT = -x -Bshareable
61 # BSD/OS 2.1, BSD/OS 3.x
64 #LDOPT = -bdynamic -bnoentry -bexpall -G
66 # other libraries to link the shared object against
69 # BSD/OS 3.0, BSD/OS 3.1
73 INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \
74 -I$(BUILD_DIR) -I$(BUILD_DIR)/lib -I$(BUILD_DIR)/builtins
77 $(CC) $(PICFLAG) $(CFLAGS) $(INC) -c -o $@ $<
80 ALLPROG = print truefalse sleep pushd finfo logname basename dirname \
81 tty pathchk tee head rmdir sprintf
82 OTHERPROG = necho getconf hello cat
87 everything: all others
90 $(LD) $(LDOPT) -o $@ sprintf.o $(LDLIBS)
93 $(LD) $(LDOPT) -o $@ print.o $(LDLIBS)
96 $(LD) $(LDOPT) -o $@ necho.o $(LDLIBS)
99 $(LD) $(LDOPT) -o $@ getconf.o $(LDLIBS)
102 $(LD) $(LDOPT) -o $@ hello.o $(LDLIBS)
104 truefalse: truefalse.o
105 $(LD) $(LDOPT) -o $@ truefalse.o $(LDLIBS)
108 $(LD) $(LDOPT) -o $@ sleep.o $(LDLIBS)
111 $(LD) $(LDOPT) -o $@ pushd.o $(LDLIBS)
114 $(LD) $(LDOPT) -o $@ finfo.o $(LDLIBS)
117 $(LD) $(LDOPT) -o $@ cat.o $(LDLIBS)
120 $(LD) $(LDOPT) -o $@ logname.o $(LDLIBS)
123 $(LD) $(LDOPT) -o $@ basename.o $(LDLIBS)
126 $(LD) $(LDOPT) -o $@ dirname.o $(LDLIBS)
129 $(LD) $(LDOPT) -o $@ tty.o $(LDLIBS)
132 $(LD) $(LDOPT) -o $@ pathchk.o $(LDLIBS)
135 $(LD) $(LDOPT) -o $@ tee.o $(LDLIBS)
138 $(LD) $(LDOPT) -o $@ rmdir.o $(LDLIBS)
141 $(LD) $(LDOPT) -o $@ head.o $(LDLIBS)
144 $(RM) $(ALLPROG) $(OTHERPROG) *.o
148 distclean maintainer-clean: clean
152 truefalse.o: truefalse.c
157 basename.o: basename.c