Advertisement
Chronos_Ouroboros

DMakefile

Aug 23rd, 2015
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. AS = gdcc-as
  2. CC = gdcc-cc
  3. LD = gdcc-ld
  4.  
  5. SOURCEDIRECTORY = C_Source
  6. INCDIR = $(SOURCEDIRECTORY)/inc
  7. SRCDIR = $(SOURCEDIRECTORY)/src
  8. OBJDIR = $(SOURCEDIRECTORY)/obj
  9. ACSDIR = PK3_Source/acs
  10.  
  11. all: $(OBJDIR) $(OBJDIR)/MasterExploder $(OBJDIR)/libGDCC $(OBJDIR)/libC $(ACSDIR) $(ACSDIR)/DME.bin
  12.  
  13. cleanall:
  14. rm -rf $(OBJDIR) $(ACSDIR)
  15.  
  16. cleanMasterExploder.bin:
  17. rm -rf $(OBJDIR)/MasterExploder $(OBJDIR)/DME.ir $(ACSDIR)
  18.  
  19. $(OBJDIR):
  20. @mkdir "$(OBJDIR)"
  21.  
  22. $(OBJDIR)/MasterExploder:
  23. @mkdir "$(OBJDIR)/MasterExploder"
  24.  
  25. $(OBJDIR)/libGDCC:
  26. @mkdir "$(OBJDIR)/libGDCC"
  27.  
  28. $(OBJDIR)/libC:
  29. @mkdir "$(OBJDIR)/libC"
  30.  
  31. $(ACSDIR):
  32. @mkdir "$(ACSDIR)"
  33.  
  34. ## ===========================================
  35. ##
  36. ## DME.bin
  37. ##
  38. ## ===========================================
  39.  
  40. MasterExploder_INC = -i$(INCDIR)
  41. MasterExploder_O = \
  42. $(OBJDIR)/MasterExploder/main.o \
  43. $(OBJDIR)/MasterExploder/weapon_stuff.o \
  44. $(OBJDIR)/MasterExploder/misc.o
  45.  
  46. $(MasterExploder_O) : $(OBJDIR)/MasterExploder/%.o : $(SRCDIR)/%.c
  47. $(CC) --warn-all --bc-target=ZDoom $(MasterExploder_INC) $< $@
  48.  
  49. $(OBJDIR)/DME.ir: $(MasterExploder_O)
  50. $(LD) -co$@ $^
  51.  
  52. $(ACSDIR)/DME.bin: $(OBJDIR)/libGDCC.ir $(OBJDIR)/libC.ir $(OBJDIR)/DME.ir
  53. $(LD) --bc-target=ZDoom -lDME -o$@ $^
  54.  
  55. ## ===========================================
  56. ##
  57. ## libGDCC
  58. ##
  59. ## ===========================================
  60.  
  61. libGDCC_IR_AS = \
  62. $(OBJDIR)/libGDCC/libGDCC_AddF.ir \
  63. $(OBJDIR)/libGDCC/libGDCC_CmpF.ir \
  64. $(OBJDIR)/libGDCC/libGDCC_CmpI.ir \
  65. $(OBJDIR)/libGDCC/libGDCC_CmpU.ir \
  66. $(OBJDIR)/libGDCC/libGDCC_DivF.ir \
  67. $(OBJDIR)/libGDCC/libGDCC_DivI.ir \
  68. $(OBJDIR)/libGDCC/libGDCC_DivU.ir \
  69. $(OBJDIR)/libGDCC/libGDCC_MulF.ir \
  70. $(OBJDIR)/libGDCC/libGDCC_MulU.ir \
  71. $(OBJDIR)/libGDCC/libGDCC_Sh.ir \
  72. $(OBJDIR)/libGDCC/libGDCC_SubF.ir
  73.  
  74. libGDCC_IR_CC = \
  75. $(OBJDIR)/libGDCC/libGDCC_alloc.ir \
  76. $(OBJDIR)/libGDCC/libGDCC_format.ir
  77.  
  78. libGDCC_IR = $(libGDCC_IR_AS) $(libGDCC_IR_CC)
  79.  
  80. $(OBJDIR)/libGDCC.ir: $(libGDCC_IR)
  81. $(LD) -co$@ $^
  82.  
  83. $(libGDCC_IR_AS) : $(OBJDIR)/libGDCC/libGDCC_%.ir :
  84. $(AS) --bc-target=ZDoom -o$@ --sys-source libGDCC/ZDACS/$*.asm
  85.  
  86. $(libGDCC_IR_CC) : $(OBJDIR)/libGDCC/libGDCC_%.ir :
  87. $(CC) --bc-target=ZDoom -o$@ --sys-source libGDCC/$*.c
  88.  
  89. ## ===========================================
  90. ##
  91. ## libC
  92. ##
  93. ## ===========================================
  94.  
  95. libc_IR_AS = \
  96. $(OBJDIR)/libC/libc_approx.ir \
  97. $(OBJDIR)/libC/libc_fpclassify.ir
  98.  
  99. libc_IR_CC = \
  100. $(OBJDIR)/libC/libc_ctype.ir \
  101. $(OBJDIR)/libC/libc_errno.ir \
  102. $(OBJDIR)/libC/libc_exp.ir \
  103. $(OBJDIR)/libC/libc_locale.ir \
  104. $(OBJDIR)/libC/libc_math.ir \
  105. $(OBJDIR)/libC/libc_printf.ir \
  106. $(OBJDIR)/libC/libc_round.ir \
  107. $(OBJDIR)/libC/libc_sort.ir \
  108. $(OBJDIR)/libC/libc_stdfix.ir \
  109. $(OBJDIR)/libC/libc_stdio.ir \
  110. $(OBJDIR)/libC/libc_stdlib.ir \
  111. $(OBJDIR)/libC/libc_string.ir \
  112. $(OBJDIR)/libC/libc_trig.ir
  113.  
  114. libc_IR = $(libc_IR_AS) $(libc_IR_CC)
  115.  
  116. $(OBJDIR)/libc.ir: $(libc_IR)
  117. $(LD) --bc-target=ZDoom -co$@ $^
  118.  
  119. $(libc_IR_AS) : $(OBJDIR)/libC/libc_%.ir :
  120. $(AS) --bc-target=ZDoom -o$@ --sys-source libc/ZDACS/$*.asm
  121.  
  122. $(libc_IR_CC) : $(OBJDIR)/libC/libc_%.ir :
  123. $(CC) --bc-target=ZDoom -o$@ --sys-source libc/$*.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement