Original Post
Within a MSVC++ makefile I have five cpp files that compile into a Lib file, if one or more of the cpp/h files have not been modified, the old corresponding obj file is used (to speed the compile), though if one fails, the old obj files is used and the lib is created without the updated code. Is there a way to delete the obj file if it fails within the makefile?
Here is the makefile:
!include <win32.mak>
#!include "dxsdk.inc"
proj=LevelObj
mycflag= /c /G6 /Yd /GZ
mycflag=/MLd /W3 /Gm /GX /Zi /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /Fo"Debug/" /Fd"Debug/" /FD /c
linkflags=/pdb:/debug /machine:I386 /pdbtype:sept
objs=ArtIntel.obj Chars.obj Items.obj Debri.obj Utils.obj
all: LevelObj.lib
ArtIntel.obj: ArtIntel.cpp ArtIntel.h
$(cc) $(cdebug) $(cflags) $(mycflag) $(cvars) ArtIntel.cpp
Chars.obj: Chars.cpp Chars.h
$(cc) $(cdebug) $(cflags) $(mycflag) $(cvars) Chars.cpp
Items.obj: Items.cpp Items.h
$(cc) $(cdebug) $(cflags) $(mycflag) $(cvars) Items.cpp
Debri.obj: Debri.cpp Debri.h
$(cc) $(cdebug) $(cflags) $(mycflag) $(cvars) Debri.cpp
Utils.obj: Utils.cpp Utils.h
$(cc) $(cdebug) $(cflags) $(mycflag) $(cvars) Utils.cpp
#$(proj).res: $(proj).rc
# rc -r -fo $(proj).res $(proj).rc
$(proj).lib: $(objs)
# Rules for cleaning out those old files
clean:
del *.bak *.pdb *.obj *.res *.exp *.map *.sbr *.bsc
cleanall:
del *.bak *.pdb *.obj *.res *.exp *.map *.sbr *.bsc *.dll *.exe *.lib
|