| MAIN PAGE | Environment | Tutorial | MakeFiles | System Shutdowm | Trouble Shooting |
For more detailed information see:
HelpNet/Make
The Makefile is read by the make program, which compares the modification timestamps of the various files to determine which object modules need to be recompiled (because either the header files, or the implemntation files changed since the last build), and then compiles them in the correct order. It then will re-build the executable image.
In this way, ONLY the necessary files will be re-compiled, and ALL the necessary files will be re-compiled. In large projects, with many files this can be a conciderable time saver - reducing the edit/compile/test cycle from hours to seconds.
However, for many small projects, the make file also provides a convienient way to bundle together all of the command line options needed to successfgully compile a program, and that is the primary way we will use it. Because we are doing cross-platform development, we need to organize numerous target specific libraries, and we will use the makefile to handle this. Below is a sample Makefile provided by WRS, and used to build the demo1 program.
# Makefile - makefile for demo/1 # # Copyright 1984-1995 Wind River Systems, Inc. # # modification history # -------------------- # 01a,11nov95,p_m written. # # DESCRIPTION # This file contains rules for building a simple VxWorks demo (demo.o) # for the desired architecture and then moving the object in its final # location. # # It also contains rules to build the client side (running on VxWorks) of # a simple client/server application. # # To build VxWorks objects for a given target do: # # % make CPU=# # Eg: to build the programs for a MC68060 target use: # # % make CPU=MC68060 # # INCLUDES # makeTarget #*/ CPU = PPC604 TOOL = gnu include $(WIND_BASE)/target/h/make/defs.bsp include $(WIND_BASE)/target/h/make/make.$(CPU)$(TOOL) include $(WIND_BASE)/target/h/make/defs.$(WIND_HOST_TYPE) default : $(DEMO_DIR) demo : demo.c $(CC) $(CFLAGS) -c -g demo.c