1.4.0.0 System building problems
1.4.0.0 System building problems (cont.)
1.4.0.0 System building problems (cont.)
1.4.0.0 System building with make
make. Comparable
tools are available on other systems
make automatically forces
recompilation of required files when it detects that the source code has
been changed after the object code was created
1.4.0.0 Sample component dependencies
include ../config.mk.$(OSTYPE) # # What is the name of the program you want to create? # TARGET=$(ALIB) # # List the object code files to be produced by compilation. # OBJS=algae.o algaeapp.o animatpn.o animatw.o \ astream.o compound.o defaults.o fontsel.o \ nodes.o stdiopn.o stdiow.o timer.o \ tracepn.o tracew.o visible.o # # The following is "boilerplate" to set up the standard compilation # commands: # .SUFFIXES: .SUFFIXES: .d .o .h .c .cc .C .cpp
RECORDDEP=-MD .c.o: ; $(CC) $(CFLAGS) $(RECORDDEP) -c $*.c .cc.o: ; $(CPP) $(CPPFLAGS) $(RECORDDEP) -c $*.cc .C.o: ; $(CPP) $(CPPFLAGS) $(RECORDDEP) -c $*.C .cpp.o: ; $(CPP) $(CPPFLAGS) $(RECORDDEP) -c $*.cpp
foo.o when a file foo.c is available,
$(CC))
$(CFLAGS) -Md -c foo.c
makefile, $CC, $CPP, $(CFLAGS), etc., are defined
in a separate configuration file, config.mk
Specific dependencies and the rules to form them
# # Targets: # all: $(TARGET) referencemanual.ps $(TARGET): $(OBJS) rm -f $(TARGET) ar cr $(TARGET) $(OBJS) $(RANLIB) $(TARGET) chmod 644 $(TARGET)
target: files it depends on commands to make it
clean: -rm -f $(TARGET) $(OBJS) $(DEPENDENCIES) referencemanual.ps: referencemanual.dvi bstsess.eps dvips referencemanual referencemanual.dvi: referencemanual.tex $(PROGRAMS) latex referencemanual
make is perfectly capable of dealing with activities besides
compilation of source code.
These look ugly, but
algae.o: algae.cpp $(APATH)/algae/algae.h \ $(ACONFIG)/algae/config.h \ $(ACONFIG)/algae/string.h \ $(APATH)/algae/astream.h \ $(VPATH)/v/v_defs.h \ $(VPATH)/v/vcolor.h $(APATH)/algae/visible.h \ $(APATH)/algae/compound.h $(APATH)/algae/algaeapp.h \ $(APATH)/algae/points.h $(VPATH)/v/vapp.h \ $(VPATH)/v/vbaseitm.h $(VPATH)/v/vfont.h \ $(VPATH)/v/vawinfo.h $(VPATH)/v/vmenu.h \ $(VPATH)/v/vpane.h $(VPATH)/v/vtimer.h \ $(VPATH)/v/vnotice.h $(VPATH)/v/vmodald.h \ $(VPATH)/v/vdialog.h $(VPATH)/v/vbasewin.h \ $(VPATH)/v/vcmdprnt.h $(VPATH)/v/vcmd.h \ $(VPATH)/v/vreply.h $(VPATH)/v/vynreply.h algaeapp.o: algaeapp.cpp $(APATH)/algae/algaeapp.h \ $(ACONFIG)/algae/config.h \ $(ACONFIG)/algae/string.h \ $(APATH)/algae/points.h $(VPATH)/v/vapp.h \ $(VPATH)/v/vbaseitm.h $(VPATH)/v/v_defs.h \ $(VPATH)/v/vfont.h \ $(VPATH)/v/vawinfo.h $(VPATH)/v/vmenu.h \ $(VPATH)/v/vpane.h $(VPATH)/v/vtimer.h \ $(APATH)/algae/animatpn.h $(VPATH)/v/vcanvas.h \ $(VPATH)/v/vcpdc.h $(VPATH)/v/vwindc.h \ $(VPATH)/v/vdc.h $(VPATH)/v/vpen.h \ $(VPATH)/v/vcolor.h $(VPATH)/v/vbrush.h \ $(VPATH)/v/vprinter.h $(VPATH)/v/vwinprtr.h \ $(VPATH)/v/vmodald.h $(VPATH)/v/vdialog.h \ $(VPATH)/v/vbasewin.h $(VPATH)/v/vcmdprnt.h \ $(VPATH)/v/vcmd.h $(VPATH)/v/vmemdc.h \ $(APATH)/algae/animatw.h $(APATH)/algae/timer.h \ $(VPATH)/v/vcmdwin.h $(VPATH)/v/vwindow.h \ $(VPATH)/v/vstatusp.h $(VPATH)/v/vcmdpane.h \ $(APATH)/algae/defaults.h $(APATH)/algae/stdiow.h \ $(APATH)/algae/stdiopn.h $(VPATH)/v/vtextcnv.h \ $(APATH)/algae/tracew.h![]()
Makefiles) quickly become large, complex,
hard to understand and expensive to maintain
make uses a simple model of change based on file update times. Source
code changes need not require re-compilation.
make does not (easily) allow versions of tools such as the compiler to
be specified
RCS. Manual
intervention is usually needed to check out source code from a version
management system for building
1.4.0.0 Integrated CM databases
1.4.0.0 CM support with an integrated DB
1.4.0.0 Database-oriented CM tools
RCS.
make