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