Subversion Repositories f9daq

Rev

Rev 198 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#cmd.exe /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86
#set INCLUDE=%INCLUDE%;"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include"
#set ROOTSYS=C:\root_v5.34.34
#
#nmake -f Makefile.win32
#
#set INCLUDE=%INCLUDE%;C:\Program Files\Microsoft SDKs\Windows\v7.1A\Include
!if "$(CFG)" == ""
!if ([findstr /c:"--build=debug" $(ROOTSYS)\bin\root-config > nul ] == 0)
CFG = Win32 Debug
!if ([findstr /c:"--disable-winrtdebug" $(ROOTSYS)\bin\root-config > nul ] == 0)
RUNTIME = Release
!else
RUNTIME = Debug
!endif
!message No configuration specified: Defaulting to Win32 Debug 
!message With $(RUNTIME) Runtime DLL (Taken from ROOT config).
!message .
!else
CFG = Win32 Release
RUNTIME = Release
!message No configuration specified: Defaulting to Win32 Release
!message With $(RUNTIME) Runtime DLL (Taken from ROOT config).
!message .
!endif
!else
!if "$(CFG)" == "Win32 Release"
RUNTIME = Release
!elseif "$(CFG)" == "Win32 Debug"
RUNTIME = Debug
!endif 
!endif 

!if "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
!message Invalid configuration "$(CFG)" specified.
!message You can specify a configuration when running NMAKE
!message by defining the macro CFG on the command line. For example:
!message 
!message NMAKE /f "Makefile.msc" CFG="Win32 Debug"
!message 
!message Possible choices for configuration are:
!message 
!message "Win32 Release" (based on "Win32 (x86) Dynamic Library")
!message "Win32 Debug" (based on "Win32 (x86) Dynamic Library")
!message 
!error An invalid configuration is specified.
!endif 
!message ROOTSYS = "$(ROOTSYS)/include" 

ObjSuf        = obj
SrcSuf        = c
SrcSuf1       = cpp
ExeSuf        = .exe
DllSuf        = dll
OutPutOpt     = -out:


## VS2012 (VC11): configure subsystem version
## See: https://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx
## (APPVER used in win32.mak to set subsystem version)
!if ([nmake /? 2>&1 | findstr /c:"Version 14\." > nul ] == 0)
APPVER        = 5.01
!endif

# Win32 system with Microsoft Visual C/C++
!include <win32.mak>
CC            = $(cc)
CXX           = $(cc)
CXXFLAGS      = -nologo -EHsc -GR -DWIN32 -W3 -D_WINDOWS -DMAIN -DDLLMAIN -DHAVE_USB  -DHAVE_LIBUSB10 -D_XKEYCHECK_H -DMYDLL_API\
                -DVISUAL_CPLUSPLUS -I$(ROOTSYS)/include -Icvi -I. \
                -wd4244 
#-FIw32pragma.h
LD            = $(link)

!if "$(CFG)" == "Win32 Release"
CXXOPT        = -O2 -arch:SSE2 -MD
LDOPT         = -opt:ref
!elseif "$(CFG)" == "Win32 Debug"
!if "$(RUNTIME)" == "Debug"
CXXOPT        = -Z7 -MDd
!else
CXXOPT        = -Z7 -O2 -arch:SSE2 -MD
!endif
LDOPT         = -debug
!endif

# Check if nmake version is 8.xx or 9.xx
!if ([nmake /? 2>&1 | findstr /c:"Version 8\." > nul ] == 0) || \
    ([nmake /? 2>&1 | findstr /c:"Version 9\." > nul ] == 0)
MT_EXE        = mt -nologo -manifest $@.manifest -outputresource:$@;1
MT_DLL        = mt -nologo -manifest $@.manifest -outputresource:$@;2
EXTRAFLAGS    = -D_CRT_SECURE_NO_DEPRECATE
!else if ([nmake /? 2>&1 | findstr /c:"Version 12\." > nul ] == 0)
MT_EXE        = 
MT_DLL        = 
EXTRAFLAGS    = 
!else if ([nmake /? 2>&1 | findstr /c:"Version 10\." > nul ] == 0)
EXTRAFLAGS    = -D_CRT_SECURE_NO_DEPRECATE
!else if ([nmake /? 2>&1 | findstr /c:"Version 14\." > nul ] == 0)
EXTRAFLAGS    = -D_CRT_SECURE_NO_DEPRECATE
!else
MT_EXE        = 
MT_DLL        = 
EXTRAFLAGS    = -G5
!endif

LDFLAGS1       = $(LDOPT) $(conlflags) -nologo -include:_G__cpp_setupG__Hist \
                -include:_G__cpp_setupG__Graf -include:_G__cpp_setupG__G3D \
                -include:_G__cpp_setupG__GPad -include:_G__cpp_setupG__Tree \
                -include:_G__cpp_setupG__Rint -include:_G__cpp_setupG__PostScript \
                -include:_G__cpp_setupG__Matrix -include:_G__cpp_setupG__Physics
                                
LDFLAGS1       = $(LDOPT) $(conlflags) -nologo 
                                
SOFLAGS       = $(dlllflags:-pdb:none=)
ROOTLIBS      = $(ROOTSYS)\lib\libCore.lib \
                $(ROOTSYS)\lib\libCint.lib $(ROOTSYS)\lib\libHist.lib \
                $(ROOTSYS)\lib\libGraf.lib $(ROOTSYS)\lib\libGraf3d.lib \
                $(ROOTSYS)\lib\libGpad.lib $(ROOTSYS)\lib\libTree.lib \
                $(ROOTSYS)\lib\libRint.lib $(ROOTSYS)\lib\libPostscript.lib \
                $(ROOTSYS)\lib\libMatrix.lib $(ROOTSYS)\lib\libPhysics.lib \
                $(ROOTSYS)\lib\libNet.lib $(ROOTSYS)\lib\libRIO.lib \
                $(ROOTSYS)\lib\libMathCore.lib
LIBS          = libusb-1.0.lib 
GLIBS         = $(LIBS) $(ROOTSYS)\lib\libGui.lib $(ROOTSYS)\lib\libGraf.lib \
                $(ROOTSYS)\lib\libGpad.lib
LIBSALL       = libusb-1.0.lib  




#------------------------------------------------------------------------------
MYAPP    = drscl$(ExeSuf)
MYAPPS   = drscl.$(SrcSuf1) musbstd.$(SrcSuf) mxml.$(SrcSuf) strlcpy.$(SrcSuf) DRS.$(SrcSuf1) averager.$(SrcSuf1)

MYAPPO   = drscl.$(ObjSuf) musbstd.$(ObjSuf) mxml.$(ObjSuf) strlcpy.$(ObjSuf) DRS.$(ObjSuf) averager.$(ObjSuf)

MYREADO =   musbstd.$(ObjSuf) mxml.$(ObjSuf)   DRS.$(ObjSuf) averager.$(ObjSuf) drsread.$(ObjSuf) XGetopt.$(ObjSuf) getopt_long.$(ObjSuf)  timer.$(ObjSuf) gettimeofday.$(ObjSuf)

OBJS          = $(MYAPPO)
PROGRAMS      = $(MYAPP)

#------------------------------------------------------------------------------

!message LDFLAGS = "$(LDFLAGS)"   
!message MYAPP = "$(MYAPP)"
!message MYAPPO = "$(MYAPPO)" 
!message PROGRAMS = "$(PROGRAMS)" 


all:            $(PROGRAMS) drsread.exe drsread.dll



RootShowerDict.$(SrcSuf): MyParticle.h MyDetector.h MyEvent.h RSLinkDef.h
                @echo "Generating dictionary $@..."
                @rootcint -f $@ -c MyParticle.h MyDetector.h MyEvent.h RSLinkDef.h

#------------------------------------------------------------------------------

clean:
       @del *.obj *Dict.* *.def *.exp *.d *.log .def *.pdb *.ilk *.manifest

distclean: clean
       @del *.exe *.root *.ps *.lib *.dll

$(MYAPP):  $(MYAPPO) 
        @echo "Compiling $@ "
                $(LD) $(LDFLAGS) /SUBSYSTEM:CONSOLE  \
                $(MYAPPO) $(LIBSALL) $(OutPutOpt)$@
                @echo "$@ done"
           
drscl.$(ObjSuf): drscl.$(SrcSuf1)
        @echo "Compiling drs $@ "
        $(CXX) $(CXXFLAGS) $(EXTRAFLAGS) $(CXXOPT) -c drscl.$(SrcSuf1)

drsread.exe:  $(MYREADO)
        @echo "Compiling $@ "
                $(LD) $(LDFLAGS) /SUBSYSTEM:CONSOLE \
                $(MYREADO)  $(LIBSALL) $(ROOTLIBS)   $(OutPutOpt)$@
                @echo "$@ done"

drsread.dll:  $(MYREADO)
        @echo "DLL library $@ "
                $(LD)  /DLL $(MYREADO)  $(LIBSALL) $(ROOTLIBS) /OUT:drsread.dll  
                @echo "$@ done"         
                

drsreadDict.cpp: drsread.h LinkDef.h
                rootcint -f drsreadDict.cpp -c drsread.h LinkDef.h
                

drsread.$(ObjSuf): drsread.$(SrcSuf1)
        @echo "Compiling drsread $@ "
        $(CXX) $(CXXFLAGS) $(EXTRAFLAGS) $(CXXOPT) -c drsread.$(SrcSuf1)
                
           
.$(SrcSuf1).$(ObjSuf):
        @echo "Compiling object $@ "
        $(CXX) $(CXXFLAGS) $(EXTRAFLAGS) $(CXXOPT) -c $<
                
.c.$(ObjSuf):
        @echo "Compiling object $@ "
        $(CXX) $(CXXFLAGS) $(EXTRAFLAGS) $(CXXOPT) -c $<