GNUmakefile 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. # OpenDoors 6.23
  2. # (C} Copyright 1991 - 1997 by Brian Pirie. All Rights Reserved.
  3. #
  4. # Oct-2001 door32.sys/socket modifications by Rob Swindell (www.synchro.net}
  5. #
  6. #
  7. # File: Win32.mak
  8. #
  9. # Description: Makefile used to build the Win32 OpenDoors libraries from
  10. # the sources. Usage is described below.
  11. #
  12. # Revisions: Date Ver Who Change
  13. # ---------------------------------------------------------------
  14. # Aug 09, 2003 6.23 SH *nix port
  15. #
  16. ###############################################################################
  17. #
  18. # USAGE INFORMATION
  19. #
  20. ###############################################################################
  21. #
  22. # Command Line: make -fWin32.mak
  23. # or
  24. # nmake /f Win32.mak
  25. #
  26. ###############################################################################
  27. #
  28. # CONFIGURATION
  29. #
  30. # Customize this section of the makefile to provide the relevant information
  31. # for your compiler, assembler (if any} and build environment.
  32. #
  33. ###############################################################################
  34. # Compiler executable file name. Use:
  35. #
  36. # tcc - For Borland Turbo C and Turbo C++
  37. # bcc - For Borland C++
  38. # cl - For Microsoft compilers
  39. #
  40. CC := gcc
  41. #
  42. #------------------------------------------------------------------------------
  43. #
  44. # Linker executable file name. Use:
  45. #
  46. # tlink - For Borland compilers
  47. # link - For Microsoft compilers
  48. #
  49. # Get OS name
  50. OS := $(shell uname)
  51. os := $(shell echo $(OS) | tr '[A-Z]' '[a-z]' | tr ' ' '_')
  52. OBJDIR := objs-$(OS)/
  53. LIBDIR := libs-$(OS)/
  54. EXEDIR := exe-$(OS)/
  55. LD := gcc
  56. ifdef DEBUG
  57. CFLAGS += -g -DOD_DEBUG
  58. BUILDTYPE := debug
  59. else
  60. BUILDTYPE := release
  61. endif
  62. #
  63. #------------------------------------------------------------------------------
  64. #
  65. # Compiler command-line flags.
  66. #
  67. CFLAGS += -fPIC
  68. LDFLAGS += -fPIC
  69. CFLAGS += -O2 -L${LIBDIR} -I../xpdev -Wall
  70. ifeq ($(OS),Darwin)
  71. CFLAGS += -D__unix__
  72. LDFLAGS += $(CFLAGS) -dynamiclib -single_module
  73. else
  74. LDFLAGS += $(CFLAGS) -shared
  75. endif
  76. ifeq ($(shell if [ -f /usr/include/inttypes.h ] ; then echo YES ; fi),YES)
  77. CFLAGS += -DHAS_INTTYPES_H
  78. endif
  79. # /MTd /Zi - for debug
  80. #
  81. #------------------------------------------------------------------------------
  82. #
  83. # Link flags.
  84. #
  85. LDFLAGS += -L../xpdev/$(LD).$(os).lib.$(BUILDTYPE)
  86. #
  87. #------------------------------------------------------------------------------
  88. #
  89. # Output directories. customize for your own preferences. Note that trailing
  90. # backslash (\} characters are required.
  91. #
  92. SHLIB := .so
  93. STATICLIB := .a
  94. OBJFILE := .o
  95. ifdef PROFILE
  96. CFLAGS += -pg
  97. SHLIB := _p${SHLIB}
  98. STATICLIB := _p.a
  99. endif
  100. #
  101. ###############################################################################
  102. #
  103. # DEPENDENCIES
  104. #
  105. # You won't normally have to change anything after this point in this makefile.
  106. #
  107. ###############################################################################
  108. #
  109. # Define primary target.
  110. #
  111. all: ${OBJDIR} ${LIBDIR} $(EXEDIR) ${LIBDIR}libODoors${SHLIB} \
  112. ${LIBDIR}libODoors${STATICLIB}
  113. #
  114. #------------------------------------------------------------------------------
  115. #
  116. # Name of all headers.
  117. #
  118. HEADERS= ${HEADERDIR}ODCom.h\
  119. ${HEADERDIR}ODCore.h\
  120. ${HEADERDIR}ODGen.h\
  121. ${HEADERDIR}ODInEx.h\
  122. ${HEADERDIR}ODInQue.h\
  123. ${HEADERDIR}ODKrnl.h\
  124. ${HEADERDIR}ODPlat.h\
  125. ${HEADERDIR}ODRes.h\
  126. ${HEADERDIR}ODScrn.h\
  127. ${HEADERDIR}ODStat.h\
  128. ${HEADERDIR}ODSwap.h\
  129. ${HEADERDIR}ODTypes.h\
  130. ${HEADERDIR}ODUtil.h\
  131. ${HEADERDIR}OpenDoor.h
  132. #
  133. #------------------------------------------------------------------------------
  134. #
  135. # Build DLL from objects.
  136. #
  137. OBJECTS := ${OBJDIR}ODAuto${OBJFILE}\
  138. ${OBJDIR}ODBlock${OBJFILE}\
  139. ${OBJDIR}ODCFile${OBJFILE}\
  140. ${OBJDIR}ODCmdLn${OBJFILE}\
  141. ${OBJDIR}ODCom${OBJFILE}\
  142. ${OBJDIR}ODCore${OBJFILE}\
  143. ${OBJDIR}ODDrBox${OBJFILE}\
  144. ${OBJDIR}ODEdit${OBJFILE}\
  145. ${OBJDIR}ODEdStr${OBJFILE}\
  146. ${OBJDIR}ODEmu${OBJFILE}\
  147. ${OBJDIR}ODGetIn${OBJFILE}\
  148. ${OBJDIR}ODGraph${OBJFILE}\
  149. ${OBJDIR}ODInEx1${OBJFILE}\
  150. ${OBJDIR}ODInEx2${OBJFILE}\
  151. ${OBJDIR}ODInQue${OBJFILE}\
  152. ${OBJDIR}ODKrnl${OBJFILE}\
  153. ${OBJDIR}ODList${OBJFILE}\
  154. ${OBJDIR}ODLog${OBJFILE}\
  155. ${OBJDIR}ODMulti${OBJFILE}\
  156. ${OBJDIR}ODPlat${OBJFILE}\
  157. ${OBJDIR}ODPCB${OBJFILE}\
  158. ${OBJDIR}ODPopup${OBJFILE}\
  159. ${OBJDIR}ODPrntf${OBJFILE}\
  160. ${OBJDIR}ODRA${OBJFILE}\
  161. ${OBJDIR}ODScrn${OBJFILE}\
  162. ${OBJDIR}ODSpawn${OBJFILE}\
  163. ${OBJDIR}ODStand${OBJFILE}\
  164. ${OBJDIR}ODStat${OBJFILE}\
  165. ${OBJDIR}ODStr${OBJFILE}\
  166. ${OBJDIR}ODUtil${OBJFILE}\
  167. ${OBJDIR}ODWCat${OBJFILE}\
  168. ${OBJDIR}ODWin${OBJFILE}
  169. # ${OBJDIR}ODoor.res
  170. # ${OBJDIR}odsys${OBJFILE}\ this file is missing
  171. ${OBJDIR}:
  172. mkdir -p ${OBJDIR}
  173. ${LIBDIR}:
  174. mkdir -p ${LIBDIR}
  175. ${EXEDIR}:
  176. mkdir -p ${EXEDIR}
  177. $(OBJDIR)%$(OBJFILE) : %.c
  178. $(CC) $(CFLAGS) -o $@ -c $<
  179. ${LIBDIR}libODoors${SHLIB} : ${OBJECTS}
  180. $(LD) $(LDFLAGS) -o ${LIBDIR}libODoors${SHLIB}.6.2 ${OBJECTS}
  181. ln -fs libODoors${SHLIB}.6.2 ${LIBDIR}libODoors${SHLIB}
  182. ${LIBDIR}libODoors${STATICLIB} : ${OBJECTS}
  183. ar -r ${LIBDIR}libODoors${STATICLIB} ${OBJECTS}
  184. ranlib ${LIBDIR}libODoors${STATICLIB}
  185. #
  186. #------------------------------------------------------------------------------