Makefile Tutorial - Libutil Makefile Example

Source_Code/libutil Makefile

#...........................................................................................................................................
#:
#: Makefile for Client Server Course Initial Assignment Programs
#: by: rjy
#: additional bugs by: J. Kabara
#:
#: creation date: 1 January 1996
#: last modification date: 9 January 1998
#: version: 2.0
#:
#: User Date Comments
#:-------+------+--------------------------------------------------------------------------------------------
#...........................................................................................................................................
##
# include all the definitions from the primary Makefile
# by including that Makefile
include ../Makefile
DEFINES = -K PIC
LIBRARY = libutil
OBJECTS = connectTCP.o \
[TABTABTAB]connectUDP.o\
[TABTABTAB]connectsock.o \
[TABTABTAB]errexit.o \
[TABTABTAB]passiveTCP.o \
[TABTABTAB]passiveUDP.o \
[TABTABTAB]passivesock.o \
[TABTABTAB]sig_handlers.o

all1 : $(LIBRARY)

install1 : $(LIBRARY)
[TAB]$(INSTALL) $(INSFLAGS) $(LIBRARY) $(DESTDIR)/lib/$(LIBRARY)
[TAB]$(RANLIB) $(DESTDIR)/lib/$(LIBRARY)

remove1 :
[TAB]$(RM) -f $(DESTDIR)/lib/$(LIBRARY)

clean1 :
[TAB]$(RM) -f *.o *.out $(LIBRARY) core

$(LIBRARY) : $(OBJECTS)
[TAB]$(AR) cr $(LIBRARY).a $(OBJECTS)
[TAB]$(RANLIB) $(LIBRARY).a
[TAB]$(INSTALL) $(INSFLAGS) -c $(DESTDIR)/lib $(LIBRARY).a
[TAB]$(CC) -K PIC -G -o $(LIBRARY).so $(OBJECTS) -lintl -lc -z text
[TAB]$(INSTALL) $(INSFLAGS) -c $(DESTDIR)/lib libutil.so
[TAB]rm $(LIBRARY).a


S. M. Garver,Spring 1998