duke3d_h=\
    $(EINC)/compat.h \
    $(EINC)/pragmas.h \
    $(EINC)/build.h \
    $(EINC)/baselayer.h \
    $(EINC)/polymer.h \
    $(EINC)/polymost.h \
    $(EINC)/texcache.h \
    $(EINC)/cache1d.h \
    $(SRC)/jmact/file_lib.h \
    $(SRC)/jmact/keyboard.h \
    $(SRC)/jmact/mouse.h \
    $(SRC)/jmact/joystick.h \
    $(SRC)/jmact/control.h \
    $(SRC)/jmact/mathutil.h \
    $(SRC)/macros.h \
    $(INC)/gamedefs.h \
    $(INC)/function.h \
    $(INC)/config.h \
    $(INC)/sounds.h \
    $(INC)/sounds_common.h \
    $(INC)/soundsdyn.h \
    $(INC)/rts.h \
    $(INC)/_rts.h \
    $(INC)/soundefs.h \
    $(JAUDIOLIBDIR)/include/fx_man.h \
    $(JAUDIOLIBDIR)/include/music.h \
    $(INC)/namesdyn.h \
    $(INC)/duke3d.h \
    $(INC)/player.h \
    $(INC)/sector.h \
    $(INC)/game.h \
    $(INC)/actors.h

gamedef_h=$(SRC)/gamedef.h $(SRC)/gameexec.h $(SRC)/gamevars.h

game_defs_dep=$(SRC)/lunatic/defs.ilua

$(OBJ)/game.$o: $(SRC)/game.c $(game_defs_dep) $(SRC)/jmact/scriplib.h $(duke3d_h) $(SRC)/input.h $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h $(INC)/demo.h $(EINC)/hightile.h $(SRC)/rev.h
$(OBJ)/actors.$o: $(SRC)/actors.c $(duke3d_h)
$(OBJ)/anim.$o: $(SRC)/anim.c $(duke3d_h) $(SRC)/input.h $(SRC)/jmact/animlib.h $(SRC)/animvpx.h
$(OBJ)/demo.$o: $(SRC)/demo.c $(duke3d_h) $(SRC)/input.h
$(OBJ)/gamedef.$o: $(SRC)/gamedef.c $(duke3d_h) $(gamedef_h) $(SRC)/savegame.h
$(OBJ)/gameexec.$o: $(SRC)/gameexec.c $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h)
$(OBJ)/gamestructures.$o: $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h)
$(OBJ)/gamevars.$o: $(SRC)/gamevars.c $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h) $(SRC)/savegame.h
$(OBJ)/global.$o: $(SRC)/*.c $(SRC)/global.c $(duke3d_h) $(SRC)/rev.h
$(OBJ)/input.$o: $(SRC)/input.c $(duke3d_h) $(SRC)/input.h
$(OBJ)/mdump.$o: $(SRC)/mdump.cpp $(SRC)/mdump.h
$(OBJ)/menus.$o: $(SRC)/menus.c $(duke3d_h) $(SRC)/input.h $(SRC)/jmact/mouse.h
$(OBJ)/namesdyn.$o: $(SRC)/namesdyn.c $(duke3d_h)
$(OBJ)/net.$o: $(SRC)/net.c $(duke3d_h)
$(OBJ)/player.$o: $(SRC)/player.c $(duke3d_h)
$(OBJ)/premap.$o: $(SRC)/premap.c $(duke3d_h) $(EINC)/osd.h
$(OBJ)/savegame.$o: $(SRC)/savegame.c $(duke3d_h) $(SRC)/savegame.h
$(OBJ)/sector.$o: $(SRC)/sector.c $(duke3d_h) $(SRC)/input.h
$(OBJ)/sounds.$o: $(SRC)/sounds.c $(duke3d_h)
$(OBJ)/soundsdyn.$o: $(SRC)/soundsdyn.c $(duke3d_h)
$(OBJ)/rts.$o: $(SRC)/rts.c $(duke3d_h)
$(OBJ)/config.$o: $(SRC)/config.c $(duke3d_h) $(SRC)/jmact/scriplib.h $(INC)/_functio.h
$(OBJ)/winbits.$o: $(SRC)/winbits.c
$(OBJ)/osdfuncs.$o: $(SRC)/names.h $(EINC)/build.h $(EINC)/osd.h
$(OBJ)/osdcmds.$o: $(SRC)/osdcmds.c $(INC)/osdcmds.h $(EINC)/osd.h $(duke3d_h)
$(OBJ)/animvpx.$o: $(SRC)/animvpx.c $(SRC)/animvpx.h $(duke3d_h) $(EINC)/glbuild.h

$(OBJ)/lunatic_game.$o: $(EINC)/lunatic.h $(SRC)/lunatic/lunatic_game.c $(SRC)/lunatic/lunatic_game.h $(SRC)/gamedef.h $(SRC)/gameexec.h $(EINC)/cache1d.h $(EINC)/osd.h
$(OBJ)/lunatic_m32.$o: $(EINC)/lunatic.h $(SRC)/lunatic/lunatic_m32.c $(SRC)/lunatic/lunatic_m32.h $(EINC)/cache1d.h $(EINC)/osd.h

# editor objects
m32_script_hs=$(EINC)/m32script.h $(SRC)/m32def.h
$(OBJ)/astub.$o: $(SRC)/astub.c \
    $(EINC)/compat.h \
    $(EINC)/build.h \
    $(EINC)/editor.h \
    $(EINC)/pragmas.h \
    $(EINC)/baselayer.h \
    $(EINC)/osd.h \
    $(EINC)/cache1d.h \
    $(EINC)/crc32.h \
    $(EINC)/scriptfile.h \
    $(EINC)/lz4.h \
    $(SRC)/macros.h \
    $(SRC)/osdfuncs.h \
    $(SRC)/names.h \
    $(SRC)/mapster32.h \
    $(SRC)/keys.h \
    $(m32_script_hs) \
    $(SRC)/rev.h
$(OBJ)/sounds_mapster32.$o: $(SRC)/sounds_mapster32.c \
    $(SRC)/sounds_mapster32.h \
    $(SRC)/sounds_common.h \
    $(EINC)/compat.h \
    $(EINC)/baselayer.h \
    $(EINC)/cache1d.h \
    $(EINC)/build.h \
    $(EINC)/editor.h \
    $(EINC)/osd.h \
    $(SRC)/macros.h \
    $(JAUDIOLIBDIR)/include/fx_man.h \
    $(SRC)/jmact/mathutil.h

$(OBJ)/m32def.$o: $(SRC)/m32def.c $(m32_script_hs) $(EINC)/cache1d.h $(SRC)/sounds_mapster32.h $(SRC)/sounds_common.h $(SRC)/keys.h
$(OBJ)/m32exec.$o: $(SRC)/m32exec.c $(m32_script_hs) $(SRC)/sounds_mapster32.h $(SRC)/sounds_common.h $(EINC)/osd.h $(SRC)/keys.h $(JAUDIOLIBDIR)/include/fx_man.h
$(OBJ)/m32structures.$o: $(SRC)/m32structures.c $(m32_script_hs) $(EINC)/compat.h $(EINC)/prlights.h
$(OBJ)/m32vars.$o: $(SRC)/m32vars.c $(SRC)/m32structures.c $(m32_script_hs) $(EINC)/osd.h $(SRC)/keys.h $(EINC)/polymer.h 

# misc objects
$(OBJ)/game_icon.$o: $(RSRC)/game_icon.c
$(OBJ)/build_icon.$o: $(RSRC)/build_icon.c

$(OBJ)/grpscan.$o: $(SRC)/grpscan.c $(EINC)/compat.h $(EINC)/baselayer.h $(EINC)/scriptfile.h $(EINC)/cache1d.h $(EINC)/crc32.h $(INC)/grpscan.h
$(OBJ)/gameres.$o: $(SRC)/misc/gameres.rc $(SRC)/startwin.game.h $(RSRC)/game.bmp $(RSRC)/game_icon.ico
$(OBJ)/buildres.$o: $(SRC)/misc/buildres.rc $(EINC)/startwin.editor.h $(RSRC)/build.bmp $(RSRC)/build_icon.ico
$(OBJ)/startwin.game.$o: $(SRC)/startwin.game.c $(duke3d_h) $(EINC)/build.h $(EINC)/winlayer.h $(EINC)/compat.h $(INC)/grpscan.h
$(OBJ)/startgtk.game.$o: $(SRC)/startgtk.game.c $(duke3d_h) $(EINC)/dynamicgtk.h $(EINC)/build.h $(EINC)/baselayer.h $(EINC)/compat.h


# jMACT objects
$(OBJ)/animlib.$o: $(SRC)/jmact/animlib.c $(SRC)/jmact/animlib.h $(EINC)/compat.h
$(OBJ)/file_lib.$o: $(SRC)/jmact/file_lib.c $(SRC)/jmact/file_lib.h 
$(OBJ)/control.$o: $(SRC)/jmact/control.c $(SRC)/jmact/control.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/mouse.h $(SRC)/jmact/joystick.h $(EINC)/baselayer.h
$(OBJ)/keyboard.$o: $(SRC)/jmact/keyboard.c $(SRC)/jmact/keyboard.h $(EINC)/compat.h $(EINC)/baselayer.h
$(OBJ)/mouse.$o: $(SRC)/jmact/mouse.c $(SRC)/jmact/mouse.h $(EINC)/baselayer.h
$(OBJ)/joystick.$o: $(SRC)/jmact/joystick.c $(SRC)/jmact/joystick.h $(EINC)/baselayer.h
$(OBJ)/mathutil.$o: $(SRC)/jmact/mathutil.c $(EINC)/compat.h $(EINC)/pragmas.h
$(OBJ)/scriplib.$o: $(SRC)/jmact/scriplib.c $(SRC)/jmact/scriplib.h $(SRC)/jmact/_scrplib.h $(EINC)/compat.h

$(OBJ)/midi.$o: $(SRC)/midi.c $(SRC)/_midi.h $(SRC)/midi.h $(JAUDIOLIBDIR)/include/music.h
$(OBJ)/mpu401.$o: $(SRC)/mpu401.c $(SRC)/mpu401.h $(JAUDIOLIBDIR)/include/music.h
$(OBJ)/music.$o: $(SRC)/music.c $(SRC)/midi.h $(SRC)/mpu401.h $(JAUDIOLIBDIR)/include/music.h

$(OBJ)/ivfrate.$o: $(SRC)/util/ivfrate.c $(SRC)/animvpx.h
