Subj : Re: Some makefile questions To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Thu Jun 16 2005 09:15 am Matthias Reuss wrote: >I know, but this is not really what I need. I would be glad to be able to >have "make" exit with return value zero in special cases. In a large >project, there is 1 subproject that needs the Visual Basic compiler. There >are several workstations that do not have this compiler, and they can do >fine without compiling this subproject; however those that have VB >(including the compile server), should regularly build it. My plan was to >check within the makefile whether the VB compiler is present. So this seems >not to be possible :-( It sounds to me that what you want to do, is for some people, not check the VB dependancies. If you don't check the dependancies, you don't try to recompile them. Here's one way to do that...2 batch files, one for VB users, one for the others. m.bat - - - - @set FILE=%1 @set RES=%1 @set USEVB=NO ::change to yes for the VB users make -fm.mak m.mak - - - - LIBPATH = whatever INCLUDEPATH = whatever CC = whatever TLINK = whatever RC = whatever VB = whatever OBJ = list of obj files less the vb.obj VBOBJ = list of the vb.obj ..c.obj: $(CC) $&.c ..cpp.obj: $(CC) $&.cpp ..rc.res: $(RC) $& !if $(USEVB)==NO VBOBJ = #Nothing ..SUFFIXES: .exe .lib .obj .asm .c .res .rc #You could also throw in a do-nothing #.vb.obj: # report need for VB rebuild # !else ..vb.obj: $(VB) whatever ..SUFFIXES: .exe .lib .obj .asm .c .res .rc .vb !endif # *Explicit Rules* $(FILE).exe: $(FILE).obj $(RES).res $(OBJ) $(VBOBJ) $(TLINK) etc. I also like the use of LIB files. $(FILE).exe: $(FILE).obj $(RES).res $(LIBS) It will just see that the lib is new or old, no sub-dependancy checks, or trying to rebuild the lib. The lib would have it's own make. .