# CONFIG.WIN32 -kuk- # # The current make-system for WIN32 # needs # * gnumake (OK, sources for WIN32 are available) # * Perl (e.g. from www.perl.com ) # * a UNIX-like shell (ouch!) # # I found no fully operational shell and no sources for WIN32 so far, # Cygnus' bash e.g. cannot handle this: # (echo a>a; echo b>>a) # Right now I use the knts that I wrote and simplified scripts. # Jeff eliminated many shell-lines in Makefile.*. # # Set this to the UNIX-like shell that you have: # # it is now possible to just use the DOS shell # #SHELL=knts # Use std path variables from ms HOME = $(HOMEDRIVE)$(HOMEPATH) # BUILD_TYPE # Currently either Vx or Host (latter used to be Unix BUILD_TYPE=Host # # optimize/debug flags # HOST_OPT = YES # -Ox : maximum optimizations # -Wn ; use this warning level (all warnings at level 4) CXX_OPT_FLAGS_YES = -Ox -W1 # -Zi : include debugging info in object files CXX_OPT_FLAGS_NO = -Zi -W1 CXX_OPT_FLAGS = $(CXX_OPT_FLAGS_$(HOST_OPT)) LINK_OPT_FLAGS_YES = LINK_OPT_FLAGS_NO = -debug LINK_OPT_FLAGS = $(LINK_OPT_FLAGS_$(HOST_OPT)) # to identify the general architecture class: # should be BSD, SYSV, WIN32, ... # is: WIN32, sun4, hpux, linux, ... # ARCH_CLASS=WIN32 # ifdef WIN32 looks better that ifeq ($(ARCH_CLASS),WIN32) ?? WIN32=1 # Compiler and utility invocation (supply path to compiler here) # (with warning flags built in) # Paths to compilers YACC = $(EYACC) LEX = $(ELEX) CC = cl -nologo CP = $(PERL) $(EPICS_BASE)/src/tools/cp.pl MV = $(PERL) $(EPICS_BASE)/src/tools/mv.pl RM = $(PERL) $(EPICS_BASE)/src/tools/rm.pl -f MKDIR = $(PERL) $(EPICS_BASE)/src/tools/mkdir.pl RMDIR = $(PERL) $(EPICS_BASE)/src/tools/rm.pl -rf EXE=.exe OBJ=.obj # Include files HOST_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) \ -I$(EPICS_BASE_INCLUDE) -I$(EPICS_BASE_INCLUDE)/os/$(ARCH_CLASS) # Operating system flags (from win32.mak) # # __STDC__=0 is a real great idea of Jeff that gives us both: # 1) define STDC for EPICS code (pretend ANSI conformance) # 2) set it to 0 to use MS C "extensions" (open for _open etc.) # because MS uses: if __STDC__ ... disable many nice things # # -MDd : use MSVCRTD (run-time as DLL, multi-thread support) # this also calls for _DLL # OP_SYS_FLAGS:=-MDd $(CXX_OPT_FLAGS) -VMG -VMV -DWIN32 -D_WIN32 -D_DEBUG -D_WINDOWS \ -D_X86_ -D_NTSDK -D_DLL -D__STDC__=0 HOST_LDLIBS:=user32.lib kernel32.lib wsock32.lib advapi32.lib winmm.lib HOST_LDFLAGS:=-nologo -libpath:$(EPICS_BASE_LIB) # Files and flags needed to link DLLs (used in RULES.Host) # # Strange but seems to work without: WIN32_DLLFLAGS should contain # an entry point: # '-entry:_DllMainCRTStartup$(DLLENTRY)' DLLENTRY:=@12 # yes, for MS it's I386 for 386, 486, Pentium! # don't mix this with VxWorks which has different BSPs for [34]86 ! WIN32_DLLFLAGS:=$(HOST_LDFLAGS) $(HOST_LDLIBS)\ -subsystem:windows -dll -incremental:no $(LINK_OPT_FLAGS) -machine:I386 ARCH_DEP_CFLAGS = ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS) HOST_CFLAGS = $(HOST_SFLAGS) $(HOST_INCLUDES) $(OP_SYS_FLAGS) HOST_CXXFLAGS = $(HOST_CFLAGS) # Target specific flags TARGET_CFLAGS = $($(basename $@)_CFLAGS) TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS) TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS) TARGET_LDFLAGS = $($(basename $@)_LDFLAGS) TARGET_LDLIBS = $($(basename $@)_LDLIBS) TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS) CFLAGS = $(HOST_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(HOST_CFLAGS) CXXFLAGS = $(HOST_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(HOST_CXXFLAGS) CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS) CXX=cl -nologo LDFLAGS=$(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(HOST_LDFLAGS) LDLIBS=$(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(HOST_LDLIBS) # Override SUN defaults COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c # Problem: MS Visual C++ does not recognize *.cc as C++ source, # we have to compile xx.cc using the flag -Tp xx.cc, # i.e. -Tp has to be immediately before the source file name COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -DEXPL_TEMPL -c -Tp LINK.c=link $(LINK_OPT_FLAGS) $(LDFLAGS) -out:$@ LINK.cc=$(LINK.c) # The DEPENDS_RULE may be a script on other systems, # if you need different rules for .c and .cc, # that script has to figure out what to call. # DEPENDS_RULE = @echo no DEPENDS_RULE defined in CONFIG.WIN32