This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
VARCem/src/win/mingw/Makefile.MinGW
waltje beac317ced Several small fixex here and there.
Applied some of the relevant upstream changes.
2018-11-02 15:45:13 -04:00

848 lines
19 KiB
Makefile

#
# VARCem Virtual ARchaeological Computer EMulator.
# An emulator of (mostly) x86-based PC systems and devices,
# using the ISA,EISA,VLB,MCA and PCI system buses, roughly
# spanning the era between 1981 and 1995.
#
# This file is part of the VARCem Project.
#
# Makefile for Windows systems using the MinGW32 environment.
#
# Version: @(#)Makefile.mingw 1.0.66 2018/10/30
#
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
#
# Copyright 2017,2018 Fred N. van Kempen.
#
# Redistribution and use in source and binary forms, with
# or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the entire
# above notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the
# following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names
# of its contributors may be used to endorse or promote
# products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Various compile-time options.
ifndef STUFF
STUFF :=
endif
# Add feature selections here.
ifndef EXTRAS
EXTRAS :=
endif
# Defaults for several build options (possibly defined in a chained file.)
ifndef AUTODEP
AUTODEP := n
endif
ifndef CRASHDUMP
CRASHDUMP := n
endif
ifndef CROSS
CROSS := n
endif
ifndef DEBUG
DEBUG := n
endif
ifndef LOGGING
LOGGING := n
endif
ifndef PROFILER
PROFILER := n
endif
ifndef OPTIM
OPTIM := n
endif
ifndef RELEASE
RELEASE := n
endif
ifndef X64
X64 := n
endif
ifndef DYNAREC
DYNAREC := y
endif
ifndef WX
WX := n
endif
ifndef USB
USB := n
endif
ifndef SDL
SDL := n
endif
ifndef D2D
D2D := n
endif
ifndef VNC
VNC := n
endif
ifndef RDP
RDP := n
endif
ifndef PNG
PNG := n
endif
ifndef DEV_BUILD
DEV_BUILD := n
endif
ifndef DEV_BRANCH
DEV_BRANCH := n
endif
ifndef AMD_K
AMD_K := n
endif
ifndef LASERXT
LASERXT := n
endif
ifndef PORTABLE3
PORTABLE3 := n
endif
ifndef I686
I686 := n
endif
ifndef OPENAL
OPENAL := y
endif
ifndef FLUIDSYNTH
FLUIDSYNTH := y
endif
ifndef MUNT
MUNT := y
endif
ifndef PAS16
PAS16 := n
endif
ifndef XL24
XL24 := n
endif
ifndef WONDER
WONDER := n
endif
ifndef PRINTER
PRINTER := n
endif
ifndef HOSTCD
HOSTCD := n
endif
# Name of the executable.
NETIF := pcap_if
ifndef PROG
ifneq ($(WX), n)
PROG := WxVARCem
else
PROG := VARCem
endif
endif
ifeq ($(DEBUG), y)
PROG := $(PROG)-d
NETIF := $(NETIF)-d
LOGGING := y
else
ifeq ($(LOGGING), y)
PROG := $(PROG)-l
endif
endif
# Which modules to include a development build.
ifeq ($(DEV_BUILD), y)
CRASHDUMP := y
DEV_BRANCH := y
AMD_K := y
LASERXT := y
PORTABLE3 := y
I686 := y
PAS16 := y
XL24 := y
WONDER := y
HOSTCD := y
endif
# WxWidgets basic info. Extract using the config program.
ifneq ($(WX), n)
EXPATH += wx
WX_CONFIG := wx-config.exe
ifeq ($(WX), y)
WX_PATH := C:/MinGW32/WxWidgets
WX_FLAGS := -I$(WX_PATH)/lib/wx/include/msw-unicode-3.0 \
-I$(WX_PATH)/include/wx-3.0 \
-D__WXMSW__ -DWX_PRECOMP -D_FILE_OFFSET_BITS=64 -pthread
# -lwx_mswu_gl-3.0 -lwxtiff-3.0 -llzma
WX_LIBS := -mwindows -mthreads -L$(WX_PATH)/lib \
-lwx_mswu-3.0.dll \
-lrpcrt4 -loleaut32 -lole32 -luuid \
-lwinspool -lwinmm -lshell32 -lcomctl32 \
-lcomdlg32 -ladvapi32 -lwsock32 -lgdi32
endif
ifeq ($(WX), static)
WX_PATH := C:/MinGW32/WxWidgets
WX_FLAGS := -I$(WX_PATH)/lib/wx/include/msw-unicode-3.0 \
-I$(WX_PATH)/include/wx-3.0 \
-D__WXMSW__ -DWX_PRECOMP -D_FILE_OFFSET_BITS=64 -pthread
# -lwx_mswu_gl-3.0 -lwxtiff-3.0 -llzma
WX_LIBS := -mwindows -mthreads -L$(WX_PATH)/lib \
-lwx_mswu-3.0 -lwxscintilla-3.0 \
-lwxjpeg-3.0 -lwxpng-3.0 -lwxzlib-3.0 \
-lwxregexu-3.0 -lwxexpat-3.0 \
-lrpcrt4 -loleaut32 -lole32 -luuid \
-lwinspool -lwinmm -lshell32 -lcomctl32 \
-lcomdlg32 -ladvapi32 -lwsock32 -lgdi32
endif
endif
#########################################################################
# Nothing should need changing from here on.. #
#########################################################################
VPATH := $(EXPATH) . cpu \
devices \
devices/cdrom devices/disk devices/floppy \
devices/floppy/lzf devices/input devices/input/game \
devices/network devices/network/slirp devices/ports \
devices/printer devices/sio devices/system devices/scsi \
devices/misc \
devices/sound \
devices/sound/munt devices/sound/munt/c_interface \
devices/sound/munt/sha1 devices/sound/munt/srchelper \
devices/sound/resid-fp \
devices/video \
machines ui win
#
# Select the required build environment. We have, uhm, many..
#
ifneq ($(CROSS), n)
# Cross-compiling (under Linux), select proper version.
ifeq ($(X64), y)
MINGW := x86_64-w64-mingw32
else
MINGW := i686-w64-mingw32
endif
ifeq ($(X64), y)
CPP := /usr/bin/$(MINGW)-g++ -m64
CC := /usr/bin/$(MINGW)-gcc -m64
else
CPP := /usr/bin/$(MINGW)-g++ -m32
CC := /usr/bin/$(MINGW)-gcc -m32
endif
PREPROC := /usr/bin/$(MINGW)-cpp
WINDRES := /usr/bin/$(MINGW)-windres
SYSINC := -I/usr/$(MINGW)/include -Iwin/mingw/include
SYSLIB := -L/usr/$(MINGW)/lib
else
# Native compilation using MinGW for Windows.
ifeq ($(X64), y)
CPP := g++ -m64
CC := gcc -m64
else
CPP := g++ -m32
CC := gcc -m32
endif
PREPROC := cpp
WINDRES := windres
ifndef CAT
CAT := cat
endif
SYSINC := -Iwin/mingw/include
SYSLIB :=
endif
DEPS = -MMD -MF $*.d -c $<
DEPFILE := win/mingw/.depends
# Set up the correct toolchain flags.
OPTS := $(EXTRAS) $(STUFF) \
-D_CRT_NON_CONFORMING_SWPRINTFS \
-D__USE_MINGW_ANSI_STDIO_X
AFLAGS := -msse2 -mfpmath=sse
RFLAGS := --input-format=rc -O coff
LDFLAGS :=
ifdef BUILD
OPTS += -DBUILD=$(BUILD)
endif
ifdef COMMIT
OPTS += -DCOMMIT=0x$(COMMIT)
endif
ifdef UPSTREAM
OPTS += -DUPSTREAM=0x$(UPSTREAM)
endif
ifdef EXFLAGS
OPTS += $(EXFLAGS)
endif
ifdef EXINC
OPTS += -I$(EXINC)
endif
OPTS += $(SYSINC)
ifneq ($(CROSS), n)
OPTS += -DUSE_CROSS
endif
ifeq ($(X64), y)
ifeq ($(OPTIM), y)
DFLAGS := -march=native
else
DFLAGS :=
endif
else
ifeq ($(OPTIM), y)
DFLAGS := -march=native
else
DFLAGS := -march=i686
endif
endif
ifeq ($(DEBUG), y)
DFLAGS += -ggdb -D_DEBUG
RFLAGS += -D_DEBUG
AOPTIM :=
ifndef COPTIM
COPTIM := -Og
endif
else
ifeq ($(OPTIM), y)
AOPTIM := -mtune=native
ifndef COPTIM
COPTIM := -O3
endif
else
ifndef COPTIM
COPTIM := -O3
endif
endif
endif
ifeq ($(PROFILER), y)
LDFLAGS += -Xlinker -Map=$(PROG).map
endif
ifeq ($(LOGGING), y)
OPTS += -D_LOGGING
RFLAGS += -D_LOGGING
endif
ifeq ($(CRASHDUMP), y)
OPTS += -DUSE_CRASHDUMP
endif
ifeq ($(RELEASE), y)
OPTS += -DRELEASE_BUILD
RFLAGS += -DRELEASE_BUILD
endif
ifeq ($(VRAMDUMP), y)
OPTS += -DENABLE_VRAM_DUMP
RFLAGS += -DENABLE_VRAM_DUMP
endif
ifeq ($(X64), y)
PLATCG := codegen_x86-64.o
CGOPS := codegen_ops_x86-64.h
VCG := vid_voodoo_codegen_x86-64.h
else
PLATCG := codegen_x86.o
CGOPS := codegen_ops_x86.h
VCG := vid_voodoo_codegen_x86.h
endif
LIBS := -mwindows \
-lddraw -ldinput8 -ldxguid -ld3d9 -ld3dx9 \
-lversion -lcomctl32 -lwinmm
LIBS += -lws2_32 -lwsock32 -liphlpapi -lpsapi
LIBS += -static -lstdc++ -lgcc
#ifneq ($(X64), y)
# LIBS += -Wl,--large-address-aware
#endif
# Optional modules.
MISCOBJ :=
ifeq ($(DYNAREC), y)
OPTS += -DUSE_DYNAREC
RFLAGS += -DUSE_DYNAREC
DYNARECOBJ := 386_dynarec_ops.o \
codegen.o \
codegen_ops.o \
codegen_timing_common.o codegen_timing_486.o \
codegen_timing_686.o codegen_timing_pentium.o \
codegen_timing_winchip.o $(PLATCG)
endif
ifeq ($(OPENAL), y)
OPTS += -DUSE_OPENAL
endif
ifeq ($(FLUIDSYNTH), y)
OPTS += -DUSE_FLUIDSYNTH
MISCOBJ += midi_fluidsynth.o
endif
ifeq ($(MUNT), y)
OPTS += -DUSE_MUNT
MISCOBJ += midi_mt32.o \
Analog.o BReverbModel.o File.o FileStream.o LA32Ramp.o \
LA32FloatWaveGenerator.o LA32WaveGenerator.o \
MidiStreamParser.o Part.o Partial.o PartialManager.o \
Poly.o ROMInfo.o SampleRateConverter_dummy.o Synth.o \
Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o
endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(SDL), n)
OPTS += -DUSE_SDL
RFLAGS += -DUSE_SDL
ifneq ($(SDL_PATH), )
OPTS += -I$(SDL_PATH)/include/mingw -I$(SDL_PATH)/include
ifeq ($(X64), y)
LIBS += -L$(SDL_PATH)/lib/mingw/x64
else
LIBS += -L$(SDL_PATH)/lib/mingw/x86
endif
endif
ifeq ($(SDL), y)
LIBS += -lsdl2
endif
SDLOBJ := win_sdl.o
endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(D2D), n)
ifeq ($(D2D), d)
OPTS += -DUSE_D2D=2
else
OPTS += -DUSE_D2D=1
endif
RFLAGS += -DUSE_D2D
ifneq ($(D2D_PATH), )
OPTS += -I$(D2D_PATH)/include/mingw -I$(D2D_PATH)/include
ifeq ($(X64), y)
LOPTS += -L$(D2D_PATH)/lib/mingw/x64
else
LOPTS += -L$(D2D_PATH)/lib/mingw/x86
endif
endif
ifeq ($(D2D), y)
LIBS += -ld2d1
endif
D2DOBJ := win_d2d.o
endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(VNC), n)
OPTS += -DUSE_VNC
RFLAGS += -DUSE_VNC
ifneq ($(VNC_PATH), )
OPTS += -I$(VNC_PATH)/include/mingw -I$(VNC_PATH)/include
ifeq ($(X64), y)
LIBS += -L$(VNC_PATH)/lib/x64
else
LIBS += -L$(VNC_PATH)/lib/x86
endif
endif
ifeq ($(VNC), y)
LIBS += -lvncserver_shared #-static -lpthreads
endif
MISCOBJ += vnc.o vnc_keymap.o
endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(RDP), n)
OPTS += -DUSE_RDP
RFLAGS += -DUSE_RDP
ifneq ($(RDP_PATH), )
OPTS += -I$(RDP_PATH)/include/mingw -I$(RDP_PATH)/include
ifeq ($(X64), y)
LIBS += -L$(RDP_PATH)/lib/x64
else
LIBS += -L$(RDP_PATH)/lib/x86
endif
endif
ifeq ($(RDP), y)
LIBS += -lrdp
endif
MISCOBJ += rdp.o
endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(PNG), n)
ifeq ($(PNG), d)
OPTS += -DUSE_LIBPNG=2
else
OPTS += -DUSE_LIBPNG=1
endif
RFLAGS += -DUSE_PNG
ifneq ($(PNG_PATH), )
OPTS += -I$(PNG_PATH)/include/mingw -I$(PNG_PATH)/include
ifeq ($(X64), y)
LIBS += -L$(PNG_PATH)/lib/x64
else
LIBS += -L$(PNG_PATH)/lib/x86
endif
endif
ifeq ($(PNG), y)
LIBS += -lpng -lz
endif
MISCOBJ += png.o
endif
# N=no, Y=yes,linked, D=yes,dynamic, S=yes,static
ifneq ($(WX), n)
OPTS += -DUSE_WX=$(WX) $(WX_FLAGS)
LIBS += $(WX_LIBS) -lm
UIOBJ := wx_main.o wx_ui.o wx_stbar.o wx_render.o
else
UIOBJ := win_ui.o \
win_ddraw.o win_d3d.o $(SDLOBJ) $(D2DOBJ) \
win_dialog.o win_about.o win_settings.o \
win_devconf.o win_snd_gain.o win_new_image.o
endif
# Options for the DEV branch.
ifeq ($(DEV_BRANCH), y)
OPTS += -DDEV_BRANCH
DEVBROBJ :=
ifeq ($(AMD_K), y)
OPTS += -DUSE_AMD_K
endif
ifeq ($(LASERXT), y)
OPTS += -DUSE_LASERXT
DEVBROBJ += m_xt_laserxt.o
endif
ifeq ($(PORTABLE3), y)
OPTS += -DUSE_PORTABLE3
endif
ifeq ($(I686), y)
OPTS += -DUSE_I686
endif
ifeq ($(PAS16), y)
OPTS += -DUSE_PAS16
DEVBROBJ += snd_pas16.o
endif
ifeq ($(WONDER), y)
OPTS += -DUSE_WONDER
endif
ifeq ($(XL24), y)
OPTS += -DUSE_XL24
endif
ifeq ($(PRINTER), y)
OPTS += -DUSE_PRINTER
DEVBROBJ += prt_parallel.o
endif
ifeq ($(HOSTCD), y)
OPTS += -DUSE_HOST_CDROM
endif
endif
# Final versions of the toolchain flags.
# FIXME: add the -Wsign-compare option soon!
CFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \
$(AFLAGS) -fomit-frame-pointer -mstackrealign \
-Wall -Wundef #-Wshadow #-Wunused-parameter -Wmissing-declarations
CXXFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \
$(AFLAGS) -fno-strict-aliasing -fvisibility=hidden \
-fvisibility-inlines-hidden \
-Wall -Wundef -Wunused-parameter -Wmissing-declarations \
-Wno-ctor-dtor-privacy -Woverloaded-virtual
#########################################################################
# Create the (final) list of objects to build. #
#########################################################################
MAINOBJ := pc.o config.o misc.o random.o timer.o io.o mem.o \
rom.o rom_load.o device.o nvr.o
UIOBJ += ui_main.o ui_lang.o ui_stbar.o ui_vidapi.o \
ui_cdrom.o ui_new_image.o ui_misc.o
SYSOBJ := dma.o nmi.o pic.o pit.o ppi.o pci.o mca.o mcr.o \
memregs.o nvr_at.o nvr_ps2.o
CPUOBJ := cpu.o cpu_table.o \
808x.o 386.o x86seg.o x87.o \
386_dynarec.o $(DYNARECOBJ)
MCHOBJ := machine.o machine_table.o \
m_xt.o m_xt_compaq.o \
m_xt_t1000.o m_xt_t1000_vid.o \
m_xt_xi8088.o \
m_pcjr.o \
m_amstrad.o m_europc.o \
m_olivetti_m24.o m_tandy.o \
m_at.o \
m_at_ali1429.o m_at_commodore.o \
m_at_neat.o m_at_headland.o \
m_at_t3100e.o m_at_t3100e_vid.o \
m_ps1.o m_ps1_hdc.o \
m_ps2_isa.o m_ps2_mca.o \
m_at_opti495.o m_at_scat.o \
m_at_compaq.o m_at_wd76c10.o \
m_at_sis_85c471.o m_at_sis_85c496.o \
m_at_4x0.o
INTELOBJ := intel.o \
intel_flash.o \
intel_sio.o \
intel_piix.o
DEVOBJ := bugger.o \
isamem.o isartc.o \
game.o game_dev.o \
parallel.o parallel_dev.o \
prt_text.o prt_cpmap.o prt_escp.o \
serial.o \
sio_fdc37c66x.o sio_fdc37c669.o sio_fdc37c93x.o \
sio_pc87306.o sio_w83877f.o sio_um8669f.o \
keyboard.o \
keyboard_xt.o keyboard_at.o \
mouse.o \
mouse_serial.o mouse_ps2.o mouse_bus.o \
joystick.o \
js_standard.o js_ch_fs_pro.o \
js_sw_pad.o js_tm_fcs.o \
FDDOBJ := fdc.o \
fdd.o \
fdd_common.o fdd_86f.o \
fdd_fdi.o fdi2raw.o lzf_c.o lzf_d.o \
fdd_imd.o fdd_img.o fdd_json.o fdd_td0.o
HDDOBJ := hdd.o \
hdd_image.o hdd_table.o \
hdc.o \
hdc_st506_xt.o hdc_st506_at.o \
hdc_esdi_at.o hdc_esdi_mca.o \
hdc_ide_ata.o hdc_ide_xta.o hdc_xtide.o
CDROMOBJ := cdrom.o \
cdrom_speed.o \
cdrom_dosbox.o cdrom_image.o
ZIPOBJ := zip.o
ifeq ($(USB), y)
USBOBJ := usb.o
endif
SCSIOBJ := scsi.o \
scsi_device.o scsi_disk.o scsi_cdrom.o \
scsi_x54x.o scsi_aha154x.o scsi_buslogic.o \
scsi_ncr5380.o scsi_ncr53c810.o
NETOBJ := network.o \
net_pcap.o \
net_slirp.o \
slirp.o slirp_misc.o \
cksum.o debug.o if.o mbuf.o queue.o sbuf.o socket.o \
arp.o bootp.o \
ip_icmp.o ip_input.o ip_output.o \
tcp_input.o tcp_output.o tcp_subr.o tcp_timer.o \
udp.o \
net_dp8390.o \
net_ne2000.o net_wd80x3.o net_3c503.o
SNDOBJ := sound.o \
sound_dev.o \
openal.o \
snd_opl.o snd_dbopl.o \
dbopl.o nukedopl.o \
snd_resid.o \
convolve.o convolve-sse.o envelope.o extfilt.o \
filter.o pot.o sid.o voice.o wave6581__ST.o \
wave6581_P_T.o wave6581_PS_.o wave6581_PST.o \
wave8580__ST.o wave8580_P_T.o wave8580_PS_.o \
wave8580_PST.o wave.o \
midi.o midi_system.o \
snd_speaker.o \
snd_lpt_dac.o snd_lpt_dss.o \
snd_adlib.o snd_adlibgold.o snd_ad1848.o snd_audiopci.o \
snd_cms.o \
snd_gus.o \
snd_sb.o snd_sb_dsp.o \
snd_emu8k.o snd_mpu401.o \
snd_sn76489.o snd_ssi2001.o \
snd_wss.o \
snd_ym7128.o
VIDOBJ := video.o \
video_dev.o \
vid_cga.o vid_cga_comp.o \
vid_cga_compaq.o \
vid_mda.o \
vid_hercules.o vid_herculesplus.o vid_incolor.o \
vid_colorplus.o \
vid_genius.o \
vid_sigma.o \
vid_wy700.o \
vid_ega.o vid_ega_render.o \
vid_svga.o vid_svga_render.o \
vid_vga.o \
vid_ati_eeprom.o \
vid_ati18800.o vid_ati28800.o \
vid_ati_mach64.o vid_ati68860_ramdac.o \
vid_bt48x_ramdac.o vid_icd2061.o vid_ics2595.o \
vid_cl54xx.o \
vid_et4000.o vid_sc1502x_ramdac.o \
vid_et4000w32.o vid_stg_ramdac.o \
vid_oak_oti.o \
vid_paradise.o \
vid_ti_cf62011.o \
vid_tvga.o \
vid_tgui9440.o vid_tkd8001_ramdac.o \
vid_s3.o vid_s3_virge.o \
vid_sdac_ramdac.o \
vid_voodoo.o
PLATOBJ := win.o \
win_lang.o win_dynld.o win_opendir.o win_thread.o \
win_cdrom.o win_keyboard.o win_mouse.o win_joystick.o \
win_midi.o
ifeq ($(CRASHDUMP), y)
PLATOBJ += win_crashdump.o
endif
OBJ := $(MAINOBJ) $(CPUOBJ) $(MCHOBJ) $(SYSOBJ) $(DEVOBJ) \
$(INTELOBJ) $(FDDOBJ) $(CDROMOBJ) $(ZIPOBJ) $(HDDOBJ) \
$(USBOBJ) $(NETOBJ) $(SCSIOBJ) $(SNDOBJ) $(VIDOBJ) \
$(UIOBJ) $(PLATOBJ) $(MISCOBJ) $(DEVBROBJ)
ifdef EXOBJ
OBJ += $(EXOBJ)
endif
# Build module rules.
ifeq ($(AUTODEP), y)
%.o: %.c
@echo $<
@$(CC) $(CFLAGS) $(DEPS) -c $<
%.o: %.cpp
@echo $<
@$(CPP) $(CXXFLAGS) $(DEPS) -c $<
else
%.o: %.c
@echo $<
@$(CC) $(CFLAGS) -c $<
%.o: %.cpp
@echo $<
@$(CPP) $(CXXFLAGS) -c $<
%.d: %.c $(wildcard $*.d)
@echo $<
@$(CC) $(CFLAGS) $(DEPS) -E $< >NUL
%.d: %.cpp $(wildcard $*.d)
@echo $<
@$(CPP) $(CXXFLAGS) $(DEPS) -E $< >NUL
endif
all: $(PREBUILD) $(PROG).exe $(NETIF).exe $(POSTBUILD)
VARCem.res: VARCem.rc VARCem.mpp
@echo Generating Manifest file..
@-rm -f win/VARCem.manifest 2>NUL
@$(PREPROC) -P win/VARCem.mpp >win/VARCem.manifest
@echo Processing $<
@$(WINDRES) $(RFLAGS) $(EXTRAS) -i $< -o VARCem.res
$(PROG).exe: $(OBJ) VARCem.res
@echo Linking $(PROG).exe ..
@$(CC) $(LDFLAGS) -o $@ \
$(OBJ) VARCem.res $(LIBS)
ifneq ($(DEBUG), y)
@strip $(PROG).exe
endif
pcap_if.res: pcap_if.rc
@echo Processing $<
@$(WINDRES) $(RFLAGS) -i $< -o pcap_if.res
$(NETIF).exe: pcap_if.o win_dynld.o pcap_if.res
@echo Linking $(NETIF).exe ..
@$(CC) $(LDFLAGS) -o $@ \
pcap_if.o win_dynld.o pcap_if.res
ifneq ($(DEBUG), y)
@strip $(NETIF).exe
endif
clean:
@echo Cleaning objects..
@-rm -f *.o
@-rm -f *.res
clobber: clean
@echo Cleaning executables..
@-rm -f *.d
@-rm -f *.exe
ifeq ($(PROFILER), y)
@-rm -f *.map
endif
@-rm -f win/*.manifest
# @-rm -f $(DEPFILE)
ifneq ($(AUTODEP), y)
depclean:
@-rm -f $(DEPFILE)
@echo Creating dependencies..
@echo # Run "make depends" to re-create this file. >$(DEPFILE)
depends: DEPOBJ=$(OBJ:%.o=%.d)
depends: depclean $(OBJ:%.o=%.d)
@$(CAT) $(DEPOBJ) >>$(DEPFILE)
# @-rm -f $(DEPOBJ)
$(DEPFILE):
endif
# Module dependencies.
ifeq ($(AUTODEP), y)
#-include $(OBJ:%.o=%.d) (better, but sloooowwwww)
-include *.d
else
include $(wildcard $(DEPFILE))
endif
# End of Makefile.mingw.