Skip to main content
GameDev.net gamedev.net
🔒 Locked

VC++ Makefile question

Started by Anarchi Oct 9, 2001 at 9:26 PM 0 replies 150+ views
Original Post
Anarchi
Anarchi
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

  
Downloads, Free GoldLib game library, D3DXSprite tutorial, New platform game: .-= The ZeroOne Realm =-.
Anarchi
Anarchi
Anyone? Any help would be appreciated
Downloads, Free GoldLib game library, D3DXSprite tutorial, New platform game: .-= The ZeroOne Realm =-.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.