i386_solaris_cc.mk 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. ##
  2. ## Solaris 11 i386 Makefile - ***USE GMAKE INSTEAD OF MAKE***
  3. ##
  4. ##
  5. TargetCPU :=i386
  6. ifeq ($(shell uname -p), sparc)
  7. MEMALIGN = -xmemalign=1i
  8. else
  9. MEMALIGN =
  10. endif
  11. OS :=solaris
  12. CXXFLAGS := -xO2 -Kpic -g $(MEMALIGN)
  13. Platform :=$(TargetCPU)-$(OS)
  14. ConfigurationName :=Release
  15. IntermediateDirectory :=../temp/$(TargetCPU)
  16. OutDir := $(IntermediateDirectory)
  17. LinkerName :=CC -library=stdcxx4 $(MEMALIGN)
  18. SharedObjectLinkerName :=CC -library=stdcxx4 -G -Kpic $(MEMALIGN)
  19. DebugSwitch :=-gstab
  20. IncludeSwitch :=-I
  21. LibrarySwitch :=-l
  22. OutputSwitch :=-o
  23. LibraryPathSwitch :=-L
  24. PreprocessorSwitch :=-D
  25. SourceSwitch :=-c
  26. OutputFile :=../bin/$(Platform)/libsnap7.so
  27. PreprocessOnlySwitch :=-E
  28. ObjectsFileList :="filelist.txt"
  29. MakeDirCommand :=mkdir -p
  30. LinkOptions := -xO2
  31. IncludePath := $(IncludeSwitch). $(IncludeSwitch)../../src/sys $(IncludeSwitch)../../src/core $(IncludeSwitch)../../src/lib
  32. Libs := $(LibrarySwitch)pthread $(LibrarySwitch)nsl $(LibrarySwitch)socket
  33. LibPath := $(LibraryPathSwitch).
  34. LibInstall := /usr/lib
  35. ##
  36. ## Common variables (CXXFLAGS varies across platforms)
  37. ##
  38. AR := ar rcus
  39. CXX := CC -library=stdcxx4 $(MEMALIGN)
  40. CC := cc
  41. CFLAGS :=
  42. ##
  43. ## User defined environment variables
  44. ##
  45. Objects0=$(IntermediateDirectory)/sys_snap_msgsock.o $(IntermediateDirectory)/sys_snap_sysutils.o $(IntermediateDirectory)/sys_snap_tcpsrvr.o $(IntermediateDirectory)/sys_snap_threads.o $(IntermediateDirectory)/core_s7_client.o $(IntermediateDirectory)/core_s7_isotcp.o $(IntermediateDirectory)/core_s7_partner.o $(IntermediateDirectory)/core_s7_peer.o $(IntermediateDirectory)/core_s7_server.o $(IntermediateDirectory)/core_s7_text.o \
  46. $(IntermediateDirectory)/core_s7_micro_client.o $(IntermediateDirectory)/lib_snap7_libmain.o
  47. Objects=$(Objects0)
  48. ##
  49. ## Main Build Targets
  50. ##
  51. .PHONY: all clean install PreBuild PostBuild
  52. all: $(OutputFile)
  53. $(OutputFile): $(IntermediateDirectory)/.d $(Objects)
  54. @$(MakeDirCommand) $(@D)
  55. @$(MakeDirCommand) $(IntermediateDirectory)
  56. @echo $(Objects0) > $(ObjectsFileList)
  57. $(SharedObjectLinkerName) $(OutputSwitch)$(OutputFile) `cat $(ObjectsFileList)` $(LibPath) $(Libs) $(LinkOptions)
  58. $(RM) $(ObjectsFileList)
  59. $(IntermediateDirectory)/.d:
  60. @test -d ../temp/$(TargetCPU) || $(MakeDirCommand) ../temp/$(TargetCPU)
  61. PreBuild:
  62. PostBuild:
  63. ##
  64. ## Objects
  65. ##
  66. $(IntermediateDirectory)/sys_snap_msgsock.o:
  67. $(CXX) $(SourceSwitch) "../../src/sys/snap_msgsock.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/sys_snap_msgsock.o $(IncludePath)
  68. $(IntermediateDirectory)/sys_snap_sysutils.o:
  69. $(CXX) $(SourceSwitch) "../../src/sys/snap_sysutils.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/sys_snap_sysutils.o $(IncludePath)
  70. $(IntermediateDirectory)/sys_snap_tcpsrvr.o:
  71. $(CXX) $(SourceSwitch) "../../src/sys/snap_tcpsrvr.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/sys_snap_tcpsrvr.o $(IncludePath)
  72. $(IntermediateDirectory)/sys_snap_threads.o:
  73. $(CXX) $(SourceSwitch) "../../src/sys/snap_threads.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/sys_snap_threads.o $(IncludePath)
  74. $(IntermediateDirectory)/core_s7_client.o:
  75. $(CXX) $(SourceSwitch) "../../src/core/s7_client.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/core_s7_client.o $(IncludePath)
  76. $(IntermediateDirectory)/core_s7_isotcp.o:
  77. $(CXX) $(SourceSwitch) "../../src/core/s7_isotcp.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/core_s7_isotcp.o $(IncludePath)
  78. $(IntermediateDirectory)/core_s7_partner.o:
  79. $(CXX) $(SourceSwitch) "../../src/core/s7_partner.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/core_s7_partner.o $(IncludePath)
  80. $(IntermediateDirectory)/core_s7_peer.o:
  81. $(CXX) $(SourceSwitch) "../../src/core/s7_peer.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/core_s7_peer.o $(IncludePath)
  82. $(IntermediateDirectory)/core_s7_server.o:
  83. $(CXX) $(SourceSwitch) "../../src/core/s7_server.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/core_s7_server.o $(IncludePath)
  84. $(IntermediateDirectory)/core_s7_text.o:
  85. $(CXX) $(SourceSwitch) "../../src/core/s7_text.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/core_s7_text.o $(IncludePath)
  86. $(IntermediateDirectory)/core_s7_micro_client.o:
  87. $(CXX) $(SourceSwitch) "../../src/core/s7_micro_client.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/core_s7_micro_client.o $(IncludePath)
  88. $(IntermediateDirectory)/lib_snap7_libmain.o:
  89. $(CXX) $(SourceSwitch) "../../src/lib/snap7_libmain.cpp" $(CXXFLAGS) -o $(IntermediateDirectory)/lib_snap7_libmain.o $(IncludePath)
  90. ##
  91. ## Clean / Install
  92. ##
  93. clean:
  94. $(RM) $(IntermediateDirectory)/*.o
  95. $(RM) $(OutputFile)
  96. install: all
  97. cp -f $(OutputFile) $(LibInstall)