i'm following through the setup for building the various host tools,
and i have a few questions.
as i read it, the basic makefile on top of which the tools building
is based is include/host-build.mk, which defines a number of default
actions such as Build/Prepare/Default, Build/Configure/Default,
Build/Compile/Default and so on. for each tool, if that action is
appropriate, that tool's Makefile doesn't need to define that action.
on the other hand, if that particular action needs to be different,
then that tool's Makefile has to redefine that action.
as an example, host-build.mk includes the snippet:
define Build/Compile/Default
$(MAKE) -C $(PKG_BUILD_DIR) $(1)
endef
but the Makefile for automake apparently needs a slightly different
compile step, so it has to redefine with:
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)
endef
as an override. is that correct?
next, i notice that host-build.mk doesn't define a default "clean"
rule, so i'm assuming that cleaning just isn't standard enough to
define such a thing, which means that each tools Makefile has to do
that explicitly. however, *if* that's the case, what does this mean
in the automake Makefile:
define Build/Clean
$(MAKE) -C $(PKG_BUILD_DIR) uninstall
$(MAKE) -C $(PKG_BUILD_DIR) clean
$(call Build/Clean/Default) <-- ???????
endef
as far as i can tell, there is no "Build/Clean/Default" defined
anywhere, is there? so what is the purpose of that line?
moving on, i can see that some Makefiles have to define the PKG_CAT
to represent the "cat" variation with which to unpack the package
source. if the source is a bz2 tarball, it's not necessary. however,
i noticed that if the tarball is simply .gz, then you normally see
PKG_CAT:=zcat
but is that really necessary? it seems like the makefile
include/unpack.mk would auto-detect the tarball type and force the use
of zcat automatically, no? or am i misreading something?
continuing, i see that host-build.mk defines the default package
build directory as:
PKG_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)$(if
$(PKG_VERSION),-$(PKG_VERSION))
but if you look at the Makefile for dtc, you read:
PKG_NAME:=dtc
PKG_VERSION:=1.1.0
...
PKG_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME) <-- is this necessary?
but wouldn't that last line be redundant? isn't that what
PKG_BUILD_DIR would be set to anyway?
as another example of what looks like a redundancy, there's the lzma
Makefile:
PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)/lzma
PKG_UNPACK:=bzcat $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR)/
$(TAR_OPTIONS)
i can see why you need to override the standard PKG_BUILD_DIR but,
once that's done, wouldn't the default PKG_UNPACK command work just
fine? after all, it should just untar the source tarball into the
PKG_BUILD_DIR, no?
anyway, that should do for now and will give me a good idea if i've
totally misunderstood some important ideas. thanks.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.
http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel