|
From: | Semethy, Stephen |
Subject: | Incremental builds |
Date: | Tue, 8 Mar 2005 12:20:30 -0600 |
I recently converted from PVCS to GNU make
and I am having a problem with incremental builds. I am running gmake 3.80 on Windows XP
Professional, using cl.exe and link.exe from MS Dev Studio 6.0. This is a
C application. I have about 6 C file1 I am compiling. The problem is after I successfully build
the DLL, I go in and change one C file. When I go to make the DLL again,
it compiles all of the C files again. I want it to just recompile the one
file and link. I tried using the –t option when I call make, but then the
file I need to get compiled is not compiled. Here is my make file layout. SHELL = /bin/sh MODULE = file6 SOURCE = $(pwd) ###################################################### # Set Source Path ###################################################### vpath %.c $(SOURCE) ###################################################### # Product Specific Subdirs For Libs and Includes ###################################################### include $(XDDB_MAKEDIR)/makeparms_$(GPRT) ###################################################### # Base Directory Listing ###################################################### OBJ_PATH = $(XDDB_SRCHOME)/$(MODULE)/$(GPRTDIR) EXEPATH =
$(XDDB_SRCHOME)/$(GEXEPATH) DEFPATH = $(XDDB_SRCHOME)/$(MODULE) ###################################################### # Include Directory Listing ###################################################### CCFLAGS = $(cvars) -G3s -Oas -DFILE6_DEFINE ###################################################### # Compilation Includes ###################################################### ###################################################### # Library Listing ###################################################### FILE=$(MODULE).dll LIB_SOURCE =
$(OBJ_PATH)/$(FILE) RCFILE=$(MODULE).rc ###################################################### # Link Libraries ###################################################### LLFLAGS = $(dlllflags) /MAP SHARED_LIBS = $(guilibs) msvcrtd.lib ###################################################### # All objects to compile from the source directory ###################################################### OBJECTS =
\
file1.$(O) \
file2.$(O) \ file3.$(O)
\ file4.$(O)
\ file5.$(O)
\ file6.$(O) ###################################################### # General Build Rules ###################################################### default: buildtree rcfile library cplib cpobj %.obj: %.c
@echo "address@hidden" >&2
$(CC) $(CFLAGS) $(CCFLAGS) /Fo$(OBJ_PATH)/$@ $< 2>&1 $(LIB_SOURCE): $(OBJECTS)
@echo "Linking_-_-$(MODULE)_-_-_" >&2
cd $(OBJ_PATH); $(LINKER) $(LFLAGS) $(LLFLAGS) /OUT:$(LIB_SOURCE) $(OBJECTS)
$(SYSLIBS) $(SHARED_LIBS) library: $(LIB_SOURCE) else ########## GENERIC ########## ilib:
@echo "Generating Import Library_-_-_$(LIB_FILE)_-_-_ ">&2
cd $(OBJ_PATH); $(ILIBCOMP) /out:$(MODULE).lib $(OBJECTS) rcfile:
@echo "Windows resource compile_-_-_$(MODULE)_-_-_" >&2
$(RCCOMP) -r $(RFLAGS) /Fo$(OBJ_PATH)/$(MODULE).res $(RCFILE) cplib:
cd $(OBJ_PATH); cp $(MODULE).lib $(MODULE).exp $(XDDB_SRCHOME)/lib/$(GPRTDIR) cpobj:
cd $(OBJ_PATH); cp $(MODULE).dll $(EXEPATH) buildtree:
@$(XDDB_MAKEDIR)/build_tree clean:
cd $(OBJ_PATH); rm -f *.o *.a *.so $(MODULE) .SUFFIXES : .o .c .SUFFIXES : .obj .c ########################################################## # Specific Target : Dependencies... section ########################################################## $(OBJ_PATH)/file5.$O: $(GINC)/file5.h $(OBJ_PATH)/file6.$O:
$(GINC)/file6.h $(OBJ_PATH)/file2.$O:
$(GINC)/file2.h $(OBJ_PATH)/file1.$O:
$(GINC)/file2.h $(GINC)/file1.h $(OBJ_PATH)/file3.$O: $(GINC)/file2.h $(GINC)/file1.h
$(GINC)/file3.h $(OBJ_PATH)/file4.$O: $(GINC)/file2.h
$(GINC)/file4.h Thank you, Stephen Semethy
Jr.
|
[Prev in Thread] | Current Thread | [Next in Thread] |