root/trunk/make/alsa-utils.mk

Revision 1327, 6.3 kB (checked in by rwhitby, 5 years ago)

Patched to use TARGET_ARCH - @FOO@ variables put in some control files, and modified on the fly using sed

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 ###########################################################
2 #
3 # alsa-utils
4 #
5 ###########################################################
6
7 # You must replace "alsa-utils" and "ALSA-UTILS" with the lower case name and
8 # upper case name of your new package.  Some places below will say
9 # "Do not change this" - that does not include this global change,
10 # which must always be done to ensure we have unique names.
11
12 #
13 # ALSA-UTILS_VERSION, ALSA-UTILS_SITE and ALSA-UTILS_SOURCE define
14 # the upstream location of the source code for the package.
15 # ALSA-UTILS_DIR is the directory which is created when the source
16 # archive is unpacked.
17 # ALSA-UTILS_UNZIP is the command used to unzip the source.
18 # It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
19 #
20 # You should change all these variables to suit your package.
21 #
22 ALSA-UTILS_SITE=ftp://ftp.alsa-project.org/pub/utils
23 ALSA-UTILS_VERSION=1.0.8
24 ALSA-UTILS_SOURCE=alsa-utils-$(ALSA-UTILS_VERSION).tar.bz2
25 ALSA-UTILS_DIR=alsa-utils-$(ALSA-UTILS_VERSION)
26 ALSA-UTILS_UNZIP=bzcat
27
28 #
29 # ALSA-UTILS_IPK_VERSION should be incremented when the ipk changes.
30 #
31 ALSA-UTILS_IPK_VERSION=1
32
33 #
34 # ALSA-UTILS_CONFFILES should be a list of user-editable files
35 ALSA-UTILS_CONFFILES=
36
37 #
38 # ALSA-UTILS_PATCHES should list any patches, in the the order in
39 # which they should be applied to the source code.
40 #
41 ALSA-UTILS_PATCHES=/dev/null
42
43 #
44 # If the compilation of the package requires additional
45 # compilation or linking flags, then list them here.
46 #
47 ALSA-UTILS_CPPFLAGS=
48 ALSA-UTILS_LDFLAGS=
49
50 #
51 # ALSA-UTILS_BUILD_DIR is the directory in which the build is done.
52 # ALSA-UTILS_SOURCE_DIR is the directory which holds all the
53 # patches and ipkg control files.
54 # ALSA-UTILS_IPK_DIR is the directory in which the ipk is built.
55 # ALSA-UTILS_IPK is the name of the resulting ipk files.
56 #
57 # You should not change any of these variables.
58 #
59 ALSA-UTILS_BUILD_DIR=$(BUILD_DIR)/alsa-utils
60 ALSA-UTILS_SOURCE_DIR=$(SOURCE_DIR)/alsa-utils
61 ALSA-UTILS_IPK_DIR=$(BUILD_DIR)/alsa-utils-$(ALSA-UTILS_VERSION)-ipk
62 ALSA-UTILS_IPK=$(BUILD_DIR)/alsa-utils_$(ALSA-UTILS_VERSION)-$(ALSA-UTILS_IPK_VERSION)_$(TARGET_ARCH).ipk
63
64 #
65 # This is the dependency on the source code.  If the source is missing,
66 # then it will be fetched from the site using wget.
67 #
68 $(DL_DIR)/$(ALSA-UTILS_SOURCE):
69         $(WGET) -P $(DL_DIR) $(ALSA-UTILS_SITE)/$(ALSA-UTILS_SOURCE)
70
71 #
72 # The source code depends on it existing within the download directory.
73 # This target will be called by the top level Makefile to download the
74 # source code's archive (.tar.gz, .bz2, etc.)
75 #
76 alsa-utils-source: $(DL_DIR)/$(ALSA-UTILS_SOURCE) $(ALSA-UTILS_PATCHES)
77
78 #
79 # This target unpacks the source code in the build directory.
80 # If the source archive is not .tar.gz or .tar.bz2, then you will need
81 # to change the commands here.  Patches to the source code are also
82 # applied in this target as required.
83 #
84 # This target also configures the build within the build directory.
85 # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
86 # and NOT $(MAKE) below.  Passing it to configure causes configure to
87 # correctly BUILD the Makefile with the right paths, where passing it
88 # to Make causes it to override the default search paths of the compiler.
89 #
90 # If the compilation of the package requires other packages to be staged
91 # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
92 #
93 $(ALSA-UTILS_BUILD_DIR)/.configured: $(DL_DIR)/$(ALSA-UTILS_SOURCE) $(ALSA-UTILS_PATCHES)
94         $(MAKE) alsa-lib-stage gettext-stage ncurses-stage
95         rm -rf $(BUILD_DIR)/$(ALSA-UTILS_DIR) $(ALSA-UTILS_BUILD_DIR)
96         $(ALSA-UTILS_UNZIP) $(DL_DIR)/$(ALSA-UTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
97         cat $(ALSA-UTILS_PATCHES) | patch -d $(BUILD_DIR)/$(ALSA-UTILS_DIR) -p1
98         mv $(BUILD_DIR)/$(ALSA-UTILS_DIR) $(ALSA-UTILS_BUILD_DIR)
99         (cd $(ALSA-UTILS_BUILD_DIR); \
100                 $(TARGET_CONFIGURE_OPTS) \
101                 CPPFLAGS="$(STAGING_CPPFLAGS) $(ALSA-UTILS_CPPFLAGS)" \
102                 LDFLAGS="$(STAGING_LDFLAGS) $(ALSA-UTILS_LDFLAGS)" \
103                 ./configure \
104                 --build=$(GNU_HOST_NAME) \
105                 --host=$(GNU_TARGET_NAME) \
106                 --target=$(GNU_TARGET_NAME) \
107                 --prefix=/opt \
108                 --disable-nls \
109         )
110         touch $(ALSA-UTILS_BUILD_DIR)/.configured
111
112 alsa-utils-unpack: $(ALSA-UTILS_BUILD_DIR)/.configured
113
114 #
115 # This builds the actual binary.
116 #
117 $(ALSA-UTILS_BUILD_DIR)/.built: $(ALSA-UTILS_BUILD_DIR)/.configured
118         rm -f $(ALSA-UTILS_BUILD_DIR)/.built
119         $(MAKE) -C $(ALSA-UTILS_BUILD_DIR)
120         touch $(ALSA-UTILS_BUILD_DIR)/.built
121
122 #
123 # This is the build convenience target.
124 #
125 alsa-utils: $(ALSA-UTILS_BUILD_DIR)/.built
126
127 #
128 # If you are building a library, then you need to stage it too.
129 #
130 $(ALSA-UTILS_BUILD_DIR)/.staged: $(ALSA-UTILS_BUILD_DIR)/.built
131         rm -f $(ALSA-UTILS_BUILD_DIR)/.staged
132         $(MAKE) -C $(ALSA-UTILS_BUILD_DIR) DESTDIR=$(STAGING_DIR) install
133         touch $(ALSA-UTILS_BUILD_DIR)/.staged
134
135 alsa-utils-stage: $(ALSA-UTILS_BUILD_DIR)/.staged
136
137 #
138 # This builds the IPK file.
139 #
140 # Binaries should be installed into $(ALSA-UTILS_IPK_DIR)/opt/sbin or $(ALSA-UTILS_IPK_DIR)/opt/bin
141 # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
142 # Libraries and include files should be installed into $(ALSA-UTILS_IPK_DIR)/opt/{lib,include}
143 # Configuration files should be installed in $(ALSA-UTILS_IPK_DIR)/opt/etc/alsa-utils/...
144 # Documentation files should be installed in $(ALSA-UTILS_IPK_DIR)/opt/doc/alsa-utils/...
145 # Daemon startup scripts should be installed in $(ALSA-UTILS_IPK_DIR)/opt/etc/init.d/S??alsa-utils
146 #
147 # You may need to patch your application to make it use these locations.
148 #
149 $(ALSA-UTILS_IPK): $(ALSA-UTILS_BUILD_DIR)/.built
150         rm -rf $(ALSA-UTILS_IPK_DIR) $(BUILD_DIR)/alsa-utils_*_$(TARGET_ARCH).ipk
151         $(MAKE) -C $(ALSA-UTILS_BUILD_DIR) DESTDIR=$(ALSA-UTILS_IPK_DIR) install
152         install -d $(ALSA-UTILS_IPK_DIR)/CONTROL
153         install -m 644 $(ALSA-UTILS_SOURCE_DIR)/control $(ALSA-UTILS_IPK_DIR)/CONTROL/control
154         echo $(ALSA-UTILS_CONFFILES) | sed -e 's/ /\n/g' > $(ALSA-UTILS_IPK_DIR)/CONTROL/conffiles
155         cd $(BUILD_DIR); $(IPKG_BUILD) $(ALSA-UTILS_IPK_DIR)
156
157 #
158 # This is called from the top level makefile to create the IPK file.
159 #
160 alsa-utils-ipk: $(ALSA-UTILS_IPK)
161
162 #
163 # This is called from the top level makefile to clean all of the built files.
164 #
165 alsa-utils-clean:
166         -$(MAKE) -C $(ALSA-UTILS_BUILD_DIR) clean
167
168 #
169 # This is called from the top level makefile to clean all dynamically created
170 # directories.
171 #
172 alsa-utils-dirclean:
173         rm -rf $(BUILD_DIR)/$(ALSA-UTILS_DIR) $(ALSA-UTILS_BUILD_DIR) $(ALSA-UTILS_IPK_DIR) $(ALSA-UTILS_IPK)
Note: See TracBrowser for help on using the browser.