Subversion Repositories pentevo

Rev

Rev 798 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

.SUFFIXES : .dep .cpp .res .o .rc
!ifdef USE_CLANG
CXX_COMPILER=clang++
CXX_LTO=
!else
CXX_COMPILER=g++
CXX_LTO=
!endif

CXX=$(CXX_COMPILER) -c
LINK=$(CXX_COMPILER)
LIB=ar
RC=windres

#-RTCsu -Qtrapuv
#-DD3DVECTOR_DEFINED
CFLAGS_COMMON=-D_CRT_SECURE_NO_DEPRECATE -DUSE_SND_EXTERNAL_BUFFER -D_PREFIX_ -std=c++17 -Wall \
 -Wno-attributes -Wno-unknown-pragmas -Wno-misleading-indentation -Wno-switch
# -Wall

!ifdef VGEMUL
CFLAGS_COMMON=$(CFLAGS_COMMON) -DVG_EMUL
!endif

!ifdef SSE1
ARCH=-march=pentium3 -msse1
CFLAGS_COMMON=$(CFLAGS_COMMON) $(ARCH)
!elseifdef SSE2
ARCH=-march=pentium4 -msse2
CFLAGS_COMMON=$(CFLAGS_COMMON) $(ARCH) -D_M_IX86_FP=2
!else
ARCH=-march=pentium2 -mmmx
CFLAGS_COMMON=$(CFLAGS_COMMON) $(ARCH)
!endif

!ifdef DEBUG
CFLAGS_DEBUG=-g -O0 -DDEBUG -D_DEBUG
LFLAGS_DEBUG=-g
!else
CFLAGS_RELEASE=-O3 -static $(CXX_LTO) -fomit-frame-pointer
LFLAGS_DEBUG=-O3 $(CXX_LTO) -static $(ARCH)
!endif

CXXFLAGS=$(CFLAGS_COMMON) $(CFLAGS_DEBUG) $(CFLAGS_RELEASE)
CFLAGS=$(CFLAGS_COMMON) $(CFLAGS_DEBUG) $(CFLAGS_RELEASE)

LFLAGS=$(LFLAGS_DEBUG)

LIBS=$(LIBS) sndrender/snd.a z80/z80.a
LIBS2=-lcomctl32 -lcomdlg32 -luser32 -lkernel32 -lgdi32 -lwinmm -ldxguid \
  -lddraw -ldsound -ldinput -ldxerr9 -lsetupapi -lgcc -lstdc++

SRCS=emul.cpp std.cpp atm.cpp cheat.cpp config.cpp dbgbpx.cpp dbgcmd.cpp dbglabls.cpp \
    dbgmem.cpp dbgoth.cpp dbgpaint.cpp dbgreg.cpp dbgrwdlg.cpp dbgtrace.cpp \
        debug.cpp draw.cpp drawnomc.cpp draw_384.cpp dx.cpp dxerr.cpp dxovr.cpp \
        dxrcopy.cpp dxrend.cpp dxrendch.cpp dxrframe.cpp dxr_4bpp.cpp dxr_512.cpp \
        dxr_advm.cpp dxr_atm.cpp dxr_atm0.cpp dxr_atm2.cpp dxr_atm4.cpp dxr_atm6.cpp \
        dxr_atm7.cpp profi.cpp \
        dxr_atmf.cpp dxr_prof.cpp dxr_rsm.cpp dxr_text.cpp dxr_vd.cpp \
        emulkeys.cpp fntsrch.cpp font.cpp font14.cpp font16.cpp \
        font8.cpp fontatm2.cpp fontdata.cpp gs.cpp gshlbass.cpp gshle.cpp \
        gsz80.cpp gui.cpp hdd.cpp hddio.cpp iehelp.cpp init.cpp \
        input.cpp inputpc.cpp io.cpp keydefs.cpp leds.cpp mainloop.cpp \
        memory.cpp modem.cpp opendlg.cpp savesnd.cpp sdcard.cpp snapshot.cpp \
        snd_bass.cpp sound.cpp sshot_png.cpp tape.cpp util.cpp vars.cpp \
        vs1001.cpp wd93cmd.cpp wd93crc.cpp fdd.cpp upd765.cpp wd93trk.cpp \
        wldr_fdi.cpp wldr_isd.cpp wldr_pro.cpp wldr_td0.cpp wldr_trd.cpp wldr_udi.cpp \
        wldr_dsk.cpp wldr_ipf.cpp z80.cpp z80asm.cpp zc.cpp savevid.cpp

OBJS=$(SRCS:.cpp=.o)

all: std.h.gch settings.res x32/emul.exe

dep: mk.dep

mk.dep: $(SRCS)
    $(CXX) $(CXXFLAGS) -MM $** >mk.dep

.c.o::
    $(CXX) $(CFLAGS) $<

std.h.gch: std.h
    $(CXX) $(CXXFLAGS) -x c++-header std.h

.cpp.o::
    $(CXX) $(CXXFLAGS)  $<

.rc.res:
    $(RC) -o$@ -i$<

.res.o:
    $(RC) -o$@ -i$<

x32/emul.exe: $(OBJS) $(LIBS) settings.o
    $(LINK) $(LFLAGS) -o$@ $** $(LIBS) $(LIBS2)

clean:
    -del *.o *.res *.map *.gch

!if exist(mk.dep)
!include mk.dep
!endif