2 ## $VER: XModule_Makefile 4.1 (15.8.98)
4 ## Copyright (C) 1993,94,95,96,97,98 by Bernardo Innocenti
6 ## This Makefile must be processed with GNU make 3.76.1
7 ## Use 4 chars wide TABs to read this file
9 ## Please see below to know what developement tools you need to
10 ## install in order to build XModule and all related files.
13 ## Relevant build targets:
15 ## make all - Make all binaries. This is the default
16 ## make release - Make distribution archives
17 ## make bumprev - Bump the revision number of XModule
18 ## make newctfiles - Make new .ct files for catalog translators
19 ## make clean - Removes all objects and temporary files
23 ###########################################################
24 # Tools used to make this project:
25 ###########################################################
27 # SAS/C 6.58 is a commercial product. Updates are available on Aminet
28 # PhxAss 4.38 is on Aminet in the archive "dev/asm/PhxAss438.lha"
29 # PhxLnk 4.31 is on Aminet in the archive "dev/asm/PhxLnk431.lha"
30 # FlexCat 2.1 is on Aminet in the archive "dev/misc/FlexCat.lha"
31 # FD2Pragma 2.52 is on Aminet in the archive "dev/misc/FD2Pragma.lha"
32 # ADtoHT 2.1 is on Aminet in the archive "text/hyper/ADtoHT2_1.lha"
33 # RevUp 1.4 is on Aminet in the archive "dev/misc/RevUp1_4.lha"
34 # GNU Make 3.76.1 is on Aminet in the archive "dev/c/make_bin.lha"
35 # GNU MakeInfo 1.64 is part of the GeekGadgets project
36 # scompare is part of the SAS/C Developement System and is not freely distributable
37 # autodoc is in the 3.1 NDTK or in the Amiga Developer CD 1.2
39 # 3.1 Includes is in the 3.1 NDTK or in the Amiga Developer CD 1.2
40 # XPK 2.5 DTK is on Aminet in the archive "util/pack/×pk25dev.lha"
41 # ReqTools DTK is on Aminet in the archive "util/libs/ReqToolDev.lha"
44 # My ethernal gratitude to the clever authors of these useful tools!
47 ###########################################################
48 # Additional configuration
49 ###########################################################
51 # Subdirectories to work in
53 SUBDIRS := Hooks gadgets manuals
56 ###########################################################
57 # Source files to compile for the XModule executible
58 ###########################################################
62 SRCS := Main.c Misc.c Rexx.c Gui.c Requesters.c Prefs.c Locale.c \
63 Audio.c Compress.c App.c Cx.c Help.c Operators.c Instr.c \
64 SongClass.c Library.c XModuleHook.c TrackerHook.c CustomClasses.c \
65 ToolBoxWin.c OptimizationWin.c ClearWin.c InstrumentsWin.c \
66 SongInfoWin.c SequenceWin.c ProgressWin.c SaversWin.c \
67 PlayWin.c PrefsWin.c PatternWin.c PattPrefsWin.c
69 # List the objects from the source files
70 OBJS := $(SRCS:%.c=$(OBJDIR)/%.o)
73 # NOTE: SampleWin.o removed because still not updated to new GUI system
77 ###########################################################
78 # Targets to make for normal builds. This is the default
79 ###########################################################
81 # NOTE: the GST file is put here to have it remade when needed.
82 # the source files do not depend on $(GST) because otherwise
83 # make would rebuild all them when the GST is rebuild.
85 all: $(GST) $(PROJNAME) Players/32Channels.player subdirs
87 final: $(GST) $(PROJNAME)_final Players/32Channels.player subdirs
90 @$(foreach subdir, $(SUBDIRS), $(MAKE) -w $(MAKEFLAGS) -C $(subdir) @@)
94 ###########################################################
95 # Patch files for special binary versions
96 ###########################################################
99 Patches/XModule_020.pch \
100 Patches/XModule_020_OS30.pch \
101 Patches/XModule.guide_39.pch \
102 Patches/XModule.guide_40.pch \
103 Patches/XModule.doc.pch \
104 Patches/pattedit.gadget_020.pch \
105 Patches/pattedit.gadget_020_OS30.pch
108 ###########################################################
109 # Files to make for the distribution
110 ###########################################################
112 release: all patches catalogs autodocs
115 @$(MAKE) -w $(MAKEFLAGS) -C catalogs
118 ###########################################################
119 # Make the Global Symbol Table used to speed up SAS/C
120 ###########################################################
122 ifneq ($(strip $(GST)),)
124 $(GST): XModulePriv.h Gui.h LocaleStrings.h Gst.c \
125 include/libraries/xmodule.h include/libraries/xmoduleclass.h \
126 include/libraries/songclass.h include/libraries/patteditclass.h \
127 include/pragmas/xmodule_pragmas.h include/clib/xmodule_protos.h
128 $(CC) FROM Gst.c MakeGst=$(GST) NOOBJNAME $(CFLAGS)
132 ###########################################################
133 # Make the main XModule executable
134 ###########################################################
136 # Generic rule for making all the objects
137 # NOTE: the `:' path separator must be escaped to avoid confusing GNU make
139 $(OBJS): $(subst :,\:,$(OBJDIR))/%.o: %.c LocaleStrings.h
140 $(CC) $< $(CC_OUT) $@ $(CFLAGS) $(MORE_CFLAGS)
142 $(OBJDIR)/Startup.o: Startup.asm
143 $(AS) Startup.asm TO $@ $(ASFLAGS) $(MORE_ASFLAGS) SET "STKSIZE=$(STACKSIZE)"
145 # NOTE: the following rule works around the command line length limit of the
146 # Amiga native shell by striping away the path component from $(OBJECTS)
147 $(PROJNAME): $(OBJDIR)/Startup.o $(OBJS)
149 $(LD) FROM $(OBJDIR)/Startup.o $(OBJS:$(OBJDIR)/%=%) TO $@ $(LDFLAGS) $(LIBS) @@\
152 # EXPERIMENTAL: to get better code optimization, we compile all the source
153 # code modules at once, by including all them in a single dummy source file.
155 $(PROJNAME)_final: $(OBJDIR)/Startup.o $(PROJNAME)_final.o
156 $(LD) FROM $(OBJDIR)/Startup.o $(OBJDIR)/$(PROJNAME)_final.o TO $@ $(LDFLAGS) $(LIBS)
158 $(PROJNAME)_final.o: $(PROJNAME)_final.c
159 $(CC) $(PROJNAME)_final.c $(CC_OUT) $(OBJDIR)/$(PROJNAME)_final.o $(CFLAGS) $(MORE_CFLAGS) \
162 $(PROJNAME)_final.c: $(SRCS)
163 echo "/** This source file is automatically generated - do not edit **/" >$(PROJNAME)_final.c
164 list $(SRCS) LFORMAT "#include *"%p%n*"" >>$(PROJNAME)_final.c
167 ###########################################################
168 # Make other executable flavors
169 ###########################################################
172 $(MAKE) -u "MORE_CFLAGS=CPU 68020" "MORE_ASFLAGS=MACHINE 68020" XModule
173 Move XModule XModule_020
176 XModule_OS30: XModule
177 $(MAKE) -u "MORE_CFLAGS=DEF OS30_ONLY" "MORE_ASFLAGS=SET OS30_ONLY" $(GST) XModule
178 Move XModule XModule_OS30
181 XModule_020_OS30: XModule
182 $(MAKE) -u "MORE_CFLAGS=CPU 68020 DEF OS30_ONLY" \
183 "MORE_ASFLAGS=SET OS30_ONLY MACHINE 68020" $(GST) XModule
184 Move XModule XModule_020_OS30
190 ###########################################################
191 # Make 32Channels.player
192 ###########################################################
195 $(AS) Player.asm $(ASFLAGS) $(MORE_ASFLAGS)
197 Players/32Channels.player: Player.o
198 $(LD) Player.o TO Players/32Channels.player LIB:Small.lib NODEBUG SMALLCODE SMALLDATA
202 ###########################################################
203 # Locale related stuff
204 ###########################################################
207 LocaleStrings.h Locale.c: LocaleStrings_h.sd Locale_c.sd Catalogs/$(PROJNAME).cd
208 $(FLEXCAT) Catalogs/$(PROJNAME).cd LocaleStrings.h=LocaleStrings_h.sd Locale.c=Locale_c.sd
210 # Make NewCTFiles to create updated CT files for all supported languages
213 @$(MAKE) -w $(MAKEFLAGS) -C catalogs NewCTFiles
218 ###########################################################
219 # Make xmodule_pragmas.h
220 ###########################################################
222 # Do not use SAS/C's fd2pragma! What you need here is FD2Pragma 2.52 or newer.
223 # It can be found on Aminet in the archive "dev/misc/FD2Pragma.lha".
226 include/pragmas/xmodule_pragmas.h: xmodule_lib.fd
227 $(FD2PRAGMA) FDFILE xmodule_lib.fd SPECIAL 6 TO include/pragmas/xmodule_pragmas.h
228 $(FD2PRAGMA) FDFILE xmodule_lib.fd SPECIAL 10 TO include/libraries/xmodule_lib.i
229 $(FD2PRAGMA) FDFILE xmodule_lib.fd SPECIAL 18 TO include/proto/xmodule.h
233 ###########################################################
235 ###########################################################
237 # autodoc is a standard Commodore developer tool. You can
238 # find it in the 3.1 NDTK.
240 # ADtoHT 2.1 is an AutoDoc to AmigaGuide file conversion
241 # utility made by Christian Stieber. It can be found on
242 # Aminet in the directory "text/hyper/".
245 autodocs: Autodocs/xmodule.doc Autodocs/songclass.doc
247 Autodocs/xmodule.doc Autodocs/songclass.doc: Library.c SongClass.c
248 $(CP) include/libraries/xmodule.h include/libraries/songclass.h Autodocs/
249 autodoc -t4 -C -I -c Library.c >Autodocs/xmodule.doc
250 autodoc -t4 -C -I -c SongClass.c >Autodocs/songclass.doc
251 SC:Doc/ADtoHT Autodocs/ RAM: Autodocs/ Autodocs/ VERSION 39
252 $(RM) Autodocs/xmodule.h
253 $(RM) Autodocs/songclass.h
256 ###########################################################
258 ###########################################################
260 # RevUp is a developer tool by Boris Folgmann which is similar to BumpRev.
261 # You can find it on Aminet in the archive "dev/misc/RevUp1_4.lha".
265 RevUp 3 XModule NOASM EXTRA TINY
268 ###########################################################
269 # Update dependencies
270 ###########################################################
272 # EXPERIMENTAL - Do not use
276 gcc -Iinclude: -Iinclude -MM *.c >depend
278 # other handy gcc options:
279 # -O2 -fomit-frame-pointer -fstrength-reduce -finline-functions -funroll-loops
280 # -W -Wunused -Wuninitialized -Wparentheses Wreturn-type -Wshadow -Wcast-align
281 # -Wstrict-prototypes
283 ###########################################################
285 ###########################################################
288 -$(RM) *.pch *.map *.gst *.xref XModule XModule.doc \
289 Locale.c LocaleStrings.h Players/*.player Patches/*.pch $(PROJNAME)_final.c depend
291 @$(MAKE) -w $(MAKEFLAGS) -C Hooks clean
292 @$(MAKE) -w $(MAKEFLAGS) -C gadgets clean
293 @$(MAKE) -w $(MAKEFLAGS) -C catalogs clean
297 ##################################################################################
298 # Make patches for special executables optimized for different CPU and OS version
299 ##################################################################################
301 Patches/XModule_020.pch: XModule_020
302 scompare -o$@ XModule XModule_020
304 Patches/XModule_020_OS30.pch: XModule_020_OS30
305 scompare -o$@ XModule XModule_020_OS30
307 Patches/pattedit.gadget_020.pch: Gadgets/pattedit.gadget_020
308 scompare -o$@ Gadgets/pattedit.gadget Gadgets/pattedit.gadget_020
310 Patches/pattedit.gadget_020_OS30.pch: Gadgets/pattedit.gadget_020_OS30
311 scompare -o$@ Gadgets/pattedit.gadget Gadgets/pattedit.gadget_020_OS30
313 Patches/XModule.guide_39.pch: manuals/XModule.guide_39
314 scompare -o$@ manuals/XModule.guide_34 manuals/XModule.guide_39
316 Patches/XModule.guide_40.pch: manuals/XModule.guide_40
317 scompare -o$@ manuals/XModule.guide_34 manuals/XModule.guide_40
319 Patches/XModule.doc.pch: manuals/XModule.txt
320 scompare -o$@ manuals/XModule.doc manuals/XModule.txt
324 ###########################################################
325 # Make the distribution archives
326 ###########################################################
328 # Note: We can't use the `#?' wildcard because the `#' character
329 # is also used to start a comment in a Makefile. This script
330 # will work only when the dos wildstar flag is set.
333 release: distribution_archive source_archive
335 distribution_archive:
337 If NOT EXISTS $(DISTPREFIX)/XModule
338 MakeDir $(DISTPREFIX)/XModule
341 $(CP) XModule $(DISTPREFIX)/XModule/
342 $(CP) manuals/XModule.doc manuals/HISTORY manuals/README $(DISTPREFIX)/XModule/
343 $(CP) manuals/XModule.guide_34 $(DISTPREFIX)/XModule/XModule.guide
344 $(CP) Players/* $(DISTPREFIX)/XModule/Players/
345 $(CP) Hooks/*.xmhook $(DISTPREFIX)/XModule/Hooks/
346 $(CP) Gadgets/pattedit.gadget $(DISTPREFIX)/XModule/Gadgets/
347 $(CP) Patches/*.pch $(DISTPREFIX)/XModule/Patches/
349 $(RM) ALL $(DISTPREFIX)/XModule/Catalogs/**
350 $(CP) ALL Catalogs $(DISTPREFIX)/XModule/Catalogs/
357 $(ARCHIVER) $(ARCNAME) XModule/** XModule.info
362 If EXISTS $(SRCARCNAME)
366 $(RM) ALL $(SRCDISTDIR)/XModuleSource/**
368 $(CP) *.c $(DISTPREFIX)/XModuleSource/
369 $(CP) *.h $(DISTPREFIX)/XModuleSource/
370 $(CP) *.asm TO $(DISTPREFIX)/XModuleSource/
371 $(CP) ALL Include $(DISTPREFIX)/XModuleSource/Include
372 $(CP) XModule.texi MakeFile XModule_rev.rev LocaleStrings_h.sd Locale_c.sd TODO SCOPTIONS $(DISTPREFIX)/XModuleSource/
374 $(CP) FakePlayer.asm $(DISTPREFIX)/XModuleSource/Player.asm
375 $(RM) $(DISTPREFIX)XModuleSource/FakePlayer.asm
377 If EXISTS $(SRCARCNAME)
380 $(ARCHIVER) $(SRCARCNAME) include
382 $(ARCHIVER) $(SRCARCNAME) XModuleSource XModuleSource.info
387 ###########################################################
388 # Phony targets (targets which arn't really files to make)
389 ###########################################################
391 .PHONY: all patches release autodocs distribution_archive source_archive \
392 NewCTFiles bumprev depend clean subdirs $(SUBDIRS)