1 ######################################################
3 # An example makefile to fetch a package from sources
4 # then fetch the ipkg updates required to the base package
5 # extract the archives into the build tree
6 # and then build the source
8 ######################################################
11 # For this example we'll use a fairly simple package that compiles easily
12 # and has sources available for download at sourceforge
13 WSHAPER
=wondershaper-1.1a
14 WSHAPER_TARGET
=wondershaper-1.1a_mipsel.ipk
15 WSHAPER_SITE
=http
://lartc.org
/wondershaper
16 WSHAPER_SOURCE
=wondershaper-1.1a.
tar.gz
17 WSHAPERIPK_SITE
=http
://openwrt.rozeware.bc.ca
/ipkg-dev
18 WSHAPERIPK_SRC
=wondershaper-1.1a-pkg.tgz
22 # define a target for the master makefile
23 wshaper-ipk
: $(BUILD_DIR
)/$(WSHAPER_TARGET
)
25 # We need to download sources if we dont have them
26 $(DL_DIR
)/$(WSHAPER_SOURCE
) :
27 $(WGET
) -P
$(DL_DIR
) $(WSHAPER_SITE
)/$(WSHAPER_SOURCE
)
29 # As well as the upstream package sources, we need the updates
31 $(DL_DIR
)/$(WSHAPERIPK_SRC
) :
32 $(WGET
) -P
$(DL_DIR
) $(WSHAPERIPK_SITE
)/$(WSHAPERIPK_SRC
)
34 # if we have the sources, they do no good unless they are unpacked
35 $(BUILD_DIR
)/$(WSHAPER
)/.unpacked
: $(DL_DIR
)/$(WSHAPER_SOURCE
)
36 tar -C
$(BUILD_DIR
) -zxf
$(DL_DIR
)/$(WSHAPER_SOURCE
)
37 touch
$(BUILD_DIR
)/$(WSHAPER
)/.unpacked
39 # with the upstream sources unpacked, they still dont do much good without
40 # the ipkg control and rule files
41 $(BUILD_DIR
)/$(WSHAPER
)/ipkg
/control
: $(BUILD_DIR
)/$(WSHAPER
)/.unpacked
$(DL_DIR
)/$(WSHAPERIPK_SRC
)
42 tar -C
$(BUILD_DIR
)/$(WSHAPER
) -zxf
$(DL_DIR
)/$(WSHAPERIPK_SRC
)
44 # now that we have it all in place, just build it
45 $(BUILD_DIR
)/$(WSHAPER_TARGET
): $(BUILD_DIR
)/$(WSHAPER
)/ipkg
/control
46 cd
$(BUILD_DIR
)/$(WSHAPER
); $(IPKG_BUILDPACKAGE
)