Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Unnamed
Saturday, October 28th, 2006 at 9:09:45pm UTC 

  1. #             __________               __   ___.
  2. #   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
  3. #   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
  4. #   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
  5. #   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
  6. #                     \/            \/     \/    \/            \/
  7. # $Id: Makefile,v 1.40 2006/10/27 21:47:49 amiconn Exp $
  8. #
  9.  
  10. INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
  11.  -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR)
  12. CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TARGET) $(EXTRA_DEFINES) \
  13.  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DCODEC
  14.  
  15. ifdef APPEXTRA
  16.    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
  17. endif
  18.  
  19. ifdef SOFTWARECODECS
  20.    CODECLIBS = -lmad -la52 -lffmpegFLAC -lTremor -lwavpack -lmusepack -lalac -lfaad -lm4a  -lspeex
  21. endif
  22.  
  23. # we "borrow" the plugin LDS file
  24. LDS := $(APPSDIR)/plugins/plugin.lds
  25.  
  26. LINKCODEC := $(OBJDIR)/codeclink.lds
  27. DEPFILE = $(OBJDIR)/dep-codecs
  28.  
  29. # This sets up 'SRC' based on the files mentioned in SOURCES
  30. include $(TOOLSDIR)/makesrc.inc
  31.  
  32. ROCKS := $(SRC:%.c=$(OBJDIR)/%.codec)
  33. SOURCES = $(SRC)
  34. ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
  35. OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
  36. # as created by the cross-compiler for win32:
  37. DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
  38. DIRS = .
  39.  
  40. CODECDEPS = $(LINKCODEC) $(BUILDDIR)/libcodec.a
  41.  
  42. .PHONY: libmad liba52 libffmpegFLAC libTremor libspeex libwavpack dumb libmusepack libalac libfaad libm4a
  43.  
  44. OUTPUT = $(SOFTWARECODECS)
  45.  
  46. all: $(LINKCODEC) $(ROCKS)
  47.  
  48. ifndef SIMVER
  49. $(BUILDDIR)/%.a : % $(CODECDEPS)
  50.  
  51. $(OBJDIR)/wav.elf : $(OBJDIR)/wav.o
  52. $(OBJDIR)/sid.elf : $(OBJDIR)/sid.o
  53. $(OBJDIR)/adx.elf : $(OBJDIR)/adx.o
  54. $(OBJDIR)/aiff.elf : $(OBJDIR)/aiff.o
  55. $(OBJDIR)/mpa.elf : $(OBJDIR)/mpa.o $(BUILDDIR)/libmad.a
  56. $(OBJDIR)/a52.elf : $(OBJDIR)/a52.o $(BUILDDIR)/liba52.a
  57. $(OBJDIR)/flac.elf : $(OBJDIR)/flac.o $(BUILDDIR)/libffmpegFLAC.a
  58. $(OBJDIR)/vorbis.elf : $(OBJDIR)/vorbis.o $(BUILDDIR)/libTremor.a
  59. $(OBJDIR)/speex.elf : $(OBJDIR)/speex.o $(BUILDDIR)/libspeex.a
  60. $(OBJDIR)/mpc.elf : $(OBJDIR)/mpc.o $(BUILDDIR)/libmusepack.a
  61. $(OBJDIR)/wavpack.elf : $(OBJDIR)/wavpack.o $(BUILDDIR)/libwavpack.a
  62. $(OBJDIR)/alac.elf : $(OBJDIR)/alac.o $(BUILDDIR)/libalac.a $(BUILDDIR)/libm4a.a
  63. $(OBJDIR)/aac.elf : $(OBJDIR)/aac.o $(BUILDDIR)/libfaad.a $(BUILDDIR)/libm4a.a
  64. $(OBJDIR)/shorten.elf : $(OBJDIR)/shorten.o $(BUILDDIR)/libffmpegFLAC.a
  65. $(OBJDIR)/mp3_enc.elf: $(OBJDIR)/mp3_enc.o
  66. $(OBJDIR)/wav_enc.elf: $(OBJDIR)/wav_enc.o
  67. $(OBJDIR)/wavpack_enc.elf: $(OBJDIR)/wavpack_enc.o $(BUILDDIR)/libwavpack.a
  68.  
  69. $(OBJDIR)/%.elf:
  70.         $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $^ -L$(BUILDDIR) -lcodec -lgcc -T$(LINKCODEC) -Wl,-Map,$(OBJDIR)/$*.map
  71.  
  72. $(OBJDIR)/%.codec : $(OBJDIR)/%.elf
  73.         $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
  74. else
  75.  
  76. ifeq ($(SIMVER), x11)
  77. ###################################################
  78. # This is the X11 simulator version
  79.  
  80. $(OBJDIR)/%.codec : $(OBJDIR)/%.o  $(BUILDDIR)/libcodec.a $(OUTPUT)
  81.         $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
  82. ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
  83. # 'x' must be kept or you'll have "Win32 error 5"
  84. #     $ fgrep 5 /usr/include/w32api/winerror.h | head -1
  85. #         #define ERROR_ACCESS_DENIED 5L
  86. else
  87.         $(SILENT)chmod -x $@
  88. endif
  89.  
  90. else    # end of x11-simulator
  91. ifeq ($(SIMVER), sdl)
  92. ###################################################
  93. # This is the SDL simulator version
  94.  
  95. $(OBJDIR)/%.codec : $(OBJDIR)/%.o  $(BUILDDIR)/libcodec.a $(OUTPUT)
  96.         $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
  97. ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
  98. # 'x' must be kept or you'll have "Win32 error 5"
  99. #     $ fgrep 5 /usr/include/w32api/winerror.h | head -1
  100. #         #define ERROR_ACCESS_DENIED 5L
  101. else
  102.         $(SILENT)chmod -x $@
  103. endif
  104.  
  105. else    # end of sdl-simulator
  106. ###################################################
  107. # This is the win32 simulator version
  108. DLLTOOLFLAGS = --export-all
  109. DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
  110.  
  111. $(OBJDIR)/%.codec : $(OBJDIR)/%.o  $(BUILDDIR)/libcodec.a $(OUTPUT)
  112.         $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
  113.         $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< \
  114.                 $(BUILDDIR)/libcodec.a $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) \
  115.                 -o $@
  116. ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
  117. # 'x' must be kept or you'll have "Win32 error 5"
  118. #     $ fgrep 5 /usr/include/w32api/winerror.h | head -1
  119. #         #define ERROR_ACCESS_DENIED 5L
  120. else
  121.         $(SILENT)chmod -x $@
  122. endif
  123. endif # end of win32-simulator
  124. endif
  125.  
  126. endif # end of simulator section
  127.  
  128. include $(TOOLSDIR)/make.inc
  129.  
  130. $(BUILDDIR)/libcodec.a:
  131.         $(SILENT)mkdir -p $(OBJDIR)/lib
  132.         $(call PRINTS,MAKE in codecs/lib)$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib
  133.  
  134. $(LINKCODEC): $(LDS)
  135.         $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) -DCODEC $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@
  136.  
  137. $(BUILDDIR)/libmad.a: libmad
  138.  
  139. libmad:
  140.         $(SILENT)mkdir -p $(OBJDIR)/libmad
  141.         $(call PRINTS,MAKE in libmad)$(MAKE) -C libmad OBJDIR=$(OBJDIR)/libmad OUTPUT=$(BUILDDIR)/libmad.a
  142.  
  143. $(BUILDDIR)/liba52.a: liba52
  144.  
  145. liba52:
  146.         $(SILENT)mkdir -p $(OBJDIR)/liba52
  147.         $(call PRINTS,MAKE in liba52)$(MAKE) -C liba52 OBJDIR=$(OBJDIR)/liba52 OUTPUT=$(BUILDDIR)/liba52.a
  148.  
  149. $(BUILDDIR)/libffmpegFLAC.a: libffmpegFLAC
  150.  
  151. libffmpegFLAC:
  152.         $(SILENT)mkdir -p $(OBJDIR)/libffmpegFLAC
  153.         $(call PRINTS,MAKE in libffmpegFLAC)$(MAKE) -C libffmpegFLAC OBJDIR=$(OBJDIR)/libffmpegFLAC OUTPUT=$(BUILDDIR)/libffmpegFLAC.a
  154.  
  155. $(BUILDDIR)/libTremor.a: libTremor
  156.  
  157. libTremor:
  158.         $(SILENT)mkdir -p $(OBJDIR)/Tremor
  159.         $(call PRINTS,MAKE in Tremor)$(MAKE) -C Tremor OBJDIR=$(OBJDIR)/Tremor OUTPUT=$(BUILDDIR)/libTremor.a
  160.  
  161. $(BUILDDIR)/libTremor.a: libspeex
  162.  
  163. libspeex:
  164.         $(SILENT)mkdir -p $(OBJDIR)/libspeex
  165.         $(call PRINTS,MAKE in Tremor)$(MAKE) -C speex OBJDIR=$(OBJDIR)/Tremor OUTPUT=$(BUILDDIR)/libspeex.a
  166.  
  167.  
  168. $(BUILDDIR)/libwavpack.a: libwavpack
  169.  
  170. libwavpack:
  171.         $(SILENT)mkdir -p $(OBJDIR)/libwavpack
  172.         $(call PRINTS,MAKE in libwavpack)$(MAKE) -C libwavpack OBJDIR=$(OBJDIR)/libwavpack OUTPUT=$(BUILDDIR)/libwavpack.a
  173.  
  174. dumb:
  175.         $(SILENT)mkdir -p $(OBJDIR)/dumb
  176.         $(call PRINTS,MAKE in dumb)$(MAKE) -C dumb OBJDIR=$(OBJDIR)/dumb LIBDIR=$(BUILDDIR) OFLAGS="$(CFLAGS)"
  177.  
  178. $(BUILDDIR)/libmusepack.a: libmusepack
  179.  
  180. libmusepack:
  181.         $(SILENT)mkdir -p $(OBJDIR)/libmusepack
  182.         $(call PRINTS,MAKE in libmusepack)$(MAKE) -C libmusepack OBJDIR=$(OBJDIR)/libmusepack OUTPUT=$(BUILDDIR)/libmusepack.a
  183.  
  184. $(BUILDDIR)/libalac.a: libalac
  185.  
  186. libalac:
  187.         $(SILENT)mkdir -p $(OBJDIR)/libalac
  188.         $(call PRINTS,MAKE in libalac)$(MAKE) -C libalac OBJDIR=$(OBJDIR)/libalac OUTPUT=$(BUILDDIR)/libalac.a
  189.  
  190. $(BUILDDIR)/libm4a.a: libm4a
  191.  
  192. libm4a:
  193.         $(SILENT)mkdir -p $(OBJDIR)/libm4a
  194.         $(call PRINTS,MAKE in libm4a)$(MAKE) -C libm4a OBJDIR=$(OBJDIR)/libm4a OUTPUT=$(BUILDDIR)/libm4a.a
  195.  
  196. $(BUILDDIR)/libfaad.a: libfaad
  197.  
  198. libfaad:
  199.         $(SILENT)mkdir -p $(OBJDIR)/libfaad
  200.         $(call PRINTS,MAKE in libfaad)$(MAKE) -C libfaad OBJDIR=$(OBJDIR)/libfaad OUTPUT=$(BUILDDIR)/libfaad.a
  201.  
  202. clean:
  203.         $(call PRINTS,cleaning codecs)rm -fr $(OBJDIR)/libmad $(BUILDDIR)/libmad.a $(OBJDIR)/liba52 $(BUILDDIR)/liba52.a $(OBJDIR)/libffmpegFLAC $(BUILDDIR)/libffmpegFLAC.a $(OBJDIR)/Tremor $(BUILDDIR)/libTremor.a $(OBJDIR)/libspeex $(BUILDDIR)/libSpeex.a $(OBJDIR)/libwavpack $(BUILDDIR)/libwavpack.a $(OBJDIR)/dumb $(BUILDDIR)/libdumb.a $(BUILDDIR)/libdumbd.a $(OBJDIR)/libmusepack $(BUILDDIR)/libmusepack.a $(OBJDIR)/libalac $(BUILDDIR)/libalac.a $(OBJDIR)/libfaad $(BUILDDIR)/libfaad.a $(OBJDIR)/libm4a $(BUILDDIR)/libm4a.a
  204.         $(SILENT)$(MAKE) -C libmad clean OBJDIR=$(OBJDIR)/libmad
  205.         $(SILENT)$(MAKE) -C liba52 clean OBJDIR=$(OBJDIR)/liba52
  206.         $(SILENT)$(MAKE) -C libffmpegFLAC clean OBJDIR=$(OBJDIR)/libffmpegFLAC
  207.         $(SILENT)$(MAKE) -C Tremor clean OBJDIR=$(OBJDIR)/Tremor
  208.         $(SILENT)$(MAKE) -C libspeex clean OBJDIR=$(OBJDIR)/libspeex
  209.         $(SILENT)$(MAKE) -C libwavpack clean OBJDIR=$(OBJDIR)/libwavpack
  210.         $(SILENT)$(MAKE) -C libmusepack clean OBJDIR=$(OBJDIR)/libmusepack
  211.         $(SILENT)$(MAKE) -C libalac clean OBJDIR=$(OBJDIR)/libalac
  212.         $(SILENT)$(MAKE) -C libfaad clean OBJDIR=$(OBJDIR)/libfaad
  213.         $(SILENT)$(MAKE) -C libm4a clean OBJDIR=$(OBJDIR)/libm4a
  214.         $(SILENT)$(MAKE) -C dumb clean OBJDIR=$(OBJDIR)/dumb
  215.         $(SILENT)$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
  216.  
  217. ifneq ($(MAKECMDGOALS),clean)
  218. -include $(DEPFILE)
  219. endif

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right worth-right