Drivers for the MNT ZZ9000 graphics and ARM coprocessor card for classic Amigas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

201 lines
6.3 KiB

  1. ###############################################################################
  2. #
  3. # Common.mk
  4. #
  5. # author: Henryk Richter <henryk.richter@gmx.net>
  6. #
  7. # note: when switching between different hardware targets, don`t forget
  8. # "make clean" in between
  9. #
  10. # tools required:
  11. # GNU Make, either VBCC or GCC for AmigaOS/68k, VASM
  12. # recent sana2.h , e.g. from RoadShow SDK
  13. #
  14. # porting:
  15. # you might need to adapt the paths (prefix for Compiler/Includes)
  16. # Some installations have ADE: instead of GG: on Amigaos
  17. # Recent work on AmigaOS cross toolchains suggest /opt/m68k-amigaos/sys-include
  18. # instead of the traditional os-include
  19. #
  20. ###############################################################################
  21. # debug = 1 will include string debugging for terminal/sushi/sashimi
  22. debug = 1
  23. # compiler_vcc = 1 will trigger VBCC, else GCC
  24. compiler_vcc = 1
  25. ###############################################################################
  26. # prefix for system includes (ASM)
  27. # native AmigaOS compilation: set PREFX=GG: or PREFX=ADE:, depending on toolchain
  28. ###############################################################################
  29. PREFX = $(VBCC)/targets/m68k-amigaos
  30. #PREFX = gg:
  31. SYSINC ?= "-I$(PREFX)/include -I$(PREFX)/include2"
  32. SYSLIB ?= "-L$(PREFX)/lib"
  33. ###############################################################################
  34. #
  35. # compiler executables (choice of gcc or vbcc)
  36. #
  37. ###############################################################################
  38. ifeq ($(compiler_vcc),1)
  39. # VBCC (use explicit vlink line for LINK= if complaints about R_PC happen)
  40. CCX = vc +aos68k $(SYSINC)
  41. LINK = vlink -bamigahunk -x -s -mrel -Cvbcc -Bstatic -nostdlib $(SYSLIB) #-Rshort
  42. #LINKEXE = vlink -bamigahunk -x -s -mrel -Cvbcc -Bstatic
  43. LINKEXE = vc +aos68k
  44. #LINK = $(CCX) -nostdlib
  45. CFLAGS = -O2 -+ -sc -c99 -cpu=$(CPU)
  46. CFLAGS2 = -Os -+ -sc -c99 -cpu=$(CPU2)
  47. else
  48. # GCC
  49. CCX = m68k-amigaos-gcc
  50. LINK = $(CCX) -nostartfiles -s
  51. LINKEXE = $(CCX) -s -noixemul
  52. CFLAGS = -O3 -s -m$(CPU) -Wall -noixemul -mregparm=4 -fomit-frame-pointer -msoft-float -noixemul
  53. CFLAGS2 = -O3 -s -m$(CPU2) -Wall -noixemul -mregparm=4 -fomit-frame-pointer -msoft-float -noixemul
  54. endif
  55. VASM = vasmm68k_mot
  56. VASMFORMAT = -m$(CPU) -Fhunk -nowarn=2064 -quiet $(SYSINC)
  57. VASMFORMAT2 = -m$(CPU2) -Fhunk -nowarn=2064 -quiet $(SYSINC)
  58. # unused here
  59. #HOST = $(shell uname)
  60. ###############################################################################
  61. #
  62. # paths to the local includes
  63. #
  64. ###############################################################################
  65. IPATH =
  66. ###############################################################################
  67. #
  68. # compile-level feature definitions
  69. #
  70. ###############################################################################
  71. ifeq ($(compiler_vcc),1)
  72. # skip quotes with VCC, the AmigaOS native version doesn't like them
  73. #DEFINES += -DDEVICEVERSION=$(DEVICEVERSION) -DDEVICEREVISION=$(DEVICEREVISION)
  74. #DEFINES += -DDEVICEDATE=$(DEVICEDATE)
  75. #DEFINES += -DDEVICEEXTRA=$(DEVICEEXTRA)
  76. DEFINES += -DDEVICENAME="$(DEVICEID)"
  77. DEFINES += -DHAVE_VERSION_H=1
  78. #DEFINES += -DNEWSTYLE
  79. #ASMDEFS += -DDEVICEVERSION=$(DEVICEVERSION) -DDEVICEREVISION=$(DEVICEREVISION)
  80. #ASMDEFS += -DDEVICEDATE=$(DEVICEDATE) -DDEVICENAME=$(DEVICEID)
  81. #DEFINES2 += -DDEVICEVERSION=$(DEVICEVERSION) -DDEVICEREVISION=$(DEVICEREVISION)
  82. #DEFINES2 += -DDEVICEDATE=$(DEVICEDATE)
  83. #DEFINES2 += -DDEVICEEXTRA=$(DEVICEEXTRA)
  84. DEFINES2 += -DDEVICENAME="$(DEVICEID2)"
  85. DEFINES2 += -DHAVE_VERSION_H=1
  86. #DEFINES2 += -DNEWSTYLE
  87. #ASMDEFS2 += -DDEVICEVERSION=$(DEVICEVERSION) -DDEVICEREVISION=$(DEVICEREVISION)
  88. else
  89. #DEFINES += -D"DEVICEVERSION=$(DEVICEVERSION)" -D"DEVICEREVISION=$(DEVICEREVISION)"
  90. #DEFINES += -D"DEVICEDATE=$(DEVICEDATE)"
  91. #DEFINES += -D"DEVICEEXTRA=$(DEVICEEXTRA)"
  92. DEFINES += -D"DEVICENAME="$(DEVICEID)""
  93. DEFINES += -DHAVE_VERSION_H=1
  94. DEFINES += -DNEWSTYLE
  95. #ASMDEFS += -DDEVICEVERSION=$(DEVICEVERSION) -DDEVICEREVISION=$(DEVICEREVISION)
  96. #ASMDEFS += -DDEVICEDATE=$(DEVICEDATE) -DDEVICENAME=$(DEVICEID)
  97. #DEFINES2 += -D"DEVICEVERSION=$(DEVICEVERSION)" -D"DEVICEREVISION=$(DEVICEREVISION)"
  98. #DEFINES2 += -D"DEVICEDATE=$(DEVICEDATE)" -D"DEVICENAME="$(DEVICEID2)""
  99. #DEFINES2 += -D"DEVICEEXTRA=$(DEVICEEXTRA)"
  100. DEFINES2 += -D"DEVICENAME="$(DEVICEID2)""
  101. DEFINES2 += -DHAVE_VERSION_H=1
  102. DEFINES2 += -DNEWSTYLE
  103. #ASMDEFS2 += -DDEVICEVERSION=$(DEVICEVERSION) -DDEVICEREVISION=$(DEVICEREVISION)
  104. endif
  105. ###############################################################################
  106. #
  107. # debug
  108. #
  109. ###############################################################################
  110. ifeq ($(debug),1)
  111. CFLAGS += -DDEBUG -g
  112. CFLAGS2 += -DDEBUG -g
  113. LINKLIBS = -L$(PREFX)/lib -ldebug -lamiga
  114. endif
  115. ###############################################################################
  116. #
  117. # compiler flags and optimization levels
  118. #
  119. ###############################################################################
  120. CFLAGS += -I. -I$(SUBDIR)
  121. CFLAGS2 += -I. -I$(SUBDIR)
  122. LDFLAGS =
  123. ###############################################################################
  124. #
  125. # objects to build
  126. #
  127. ###############################################################################
  128. # ASM based alternative to deviceheader.o would be romtag.o
  129. OBJECTS = deviceheader.o deviceinit.o device.o
  130. OBJECTS += $(ASMOBJECTS)
  131. # used for secondary build
  132. OBJECTS2 = $(patsubst %.o,%.2o,$(OBJECTS))
  133. ###############################################################################
  134. #
  135. # rules and commands
  136. #
  137. ###############################################################################
  138. all: $(DEVICEID) $(DEVICEID2) $(TESTTOOL) $(TESTTOOL2)
  139. clean:
  140. rm -f $(OBJECTS) $(OBJECTS2)
  141. rm -f $(DEVICEID) $(DEVICEID2) $(EXTRACLEAN)
  142. # not for cross compile :-)
  143. install: $(DEVICEID) $(DEVICEID2)
  144. copy $(DEVICEID) $(DEVICEID2) DEVS:
  145. #sdnet: $(DEVICEID)
  146. #expnet: $(DEVICEID2)
  147. $(DEVICEID) : $(OBJECTS)
  148. $(LINK) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKLIBS) $(LINKOPTS)
  149. # separate ruleset for each subdirectory, ./src overrides all other paths for priority
  150. # of platform-optimized routines
  151. %.o : %.c
  152. $(CCX) -c $(CFLAGS) $(DEFINES) $(IPATH) $< -o $@
  153. %.o : %.asm
  154. ${VASM} $(VASMFORMAT) $(ASMDEFS) -o $@ $<
  155. # secondary ruleset (used for expnet, will be ignored if DEVICEID2 is empty)
  156. $(DEVICEID2) : $(OBJECTS2)
  157. $(LINK) $(LDFLAGS) -o $@ $(OBJECTS2) $(LINKLIBS)
  158. %.2o : %.c
  159. $(CCX) -c $(CFLAGS2) $(DEFINES2) $(IPATH) $< -o $@
  160. %.2o : %.asm
  161. ${VASM} $(VASMFORMAT2) $(ASMDEFS2) -o $@ $<