update master mirror url
[openwrt.git] / obsolete-buildroot / make / pppoecd.mk
1 # build the Linksys pppoecd
2
3 # Note that this patches the linksys pppd before patching pppoecd.
4 # The pppd patch changes the pathnames that pppoecd will use.
5 # In an attempt to avoid conflicts the marker file is called
6 # .patched-pppoecd in the pppd directory.
7
8 PPPD_DIR=$(BUILD_DIR)/WRT54GS/release/src/router/ppp/pppd
9 PPPD_PATCH_DIR=$(OPENWRT_IPK_DIR)/pppoecd
10
11 PPPOECD_DIR=$(BUILD_DIR)/WRT54GS/release/src/router/ppp/pppoecd
12 PPPOECD_IPK_DIR=$(OPENWRT_IPK_DIR)/pppoecd
13 PPPOECD_IPK_BUILD_DIR=$(BUILD_DIR)/pppoecd-1.0
14 PPPOECD_PACKAGE=$(BUILD_DIR)/pppoecd_1.0_mipsel.ipk
15 PPPOECD_BIN=$(TARGET_DIR)/sbin/pppoecd
16 PPPOECD_IPK_BIN=$(PPPOECD_IPK_BUILD_DIR)/sbin/pppoecd
17
18 # patch pppd for the openwrt compatible path names
19 $(PPPD_DIR)/.patched-pppoecd: $(BUILD_DIR)/WRT54GS/.source
20 cat $(PPPD_PATCH_DIR)/pppoecd-pathnames.patch | patch -d $(PPPD_DIR)
21 touch $(PPPD_DIR)/.patched-pppoecd
22
23 # patch the pppoecd itself for GCC3.x compatibility and to move pppoecd to /sbin
24 $(PPPOECD_DIR)/.patched: $(PPPD_DIR)/.patched-pppoecd
25 cat $(PPPOECD_IPK_DIR)/pppoecd.patch | patch -d $(PPPOECD_DIR)
26 touch $(PPPOECD_DIR)/.patched
27
28 # build the pppoecd binary for the ipk version
29 $(PPPOECD_IPK_BIN): $(PPPOECD_DIR)/.patched
30 mkdir -p $(PPPOECD_IPK_BUILD_DIR)/etc/ppp
31 cp $(PPPOECD_IPK_DIR)/root/etc/ppp/ip-up $(PPPOECD_IPK_BUILD_DIR)/etc/ppp/ip-up
32 chmod a+x $(PPPOECD_IPK_BUILD_DIR)/etc/ppp/ip-up
33 $(MAKE) -C $(PPPOECD_DIR) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld \
34 SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(PPPOECD_IPK_BUILD_DIR) LIBDIR=$(UCLIBC_DIR)/lib \
35 STRIP="$(STRIP)" \
36 install
37
38 # setup ipkg control files
39 $(PPPOECD_IPK_BUILD_DIR)/CONTROL/control:
40 mkdir -p $(PPPOECD_IPK_BUILD_DIR)/CONTROL
41 cp $(PPPOECD_IPK_DIR)/CONTROL/prerm $(PPPOECD_IPK_BUILD_DIR)/CONTROL/prerm
42 chmod a+x $(PPPOECD_IPK_BUILD_DIR)/CONTROL/prerm
43 cp $(PPPOECD_IPK_DIR)/CONTROL/postrm $(PPPOECD_IPK_BUILD_DIR)/CONTROL/postrm
44 chmod a+x $(PPPOECD_IPK_BUILD_DIR)/CONTROL/postrm
45 cp $(PPPOECD_IPK_DIR)/CONTROL/conffiles $(PPPOECD_IPK_BUILD_DIR)/CONTROL/conffiles
46 cp $(PPPOECD_IPK_DIR)/CONTROL/control $(PPPOECD_IPK_BUILD_DIR)/CONTROL/control
47
48 # build the ipk package
49 $(PPPOECD_PACKAGE): $(PPPOECD_IPK_BIN) $(PPPOECD_IPK_BUILD_DIR)/CONTROL/control
50 cd $(BUILD_DIR); $(IPKG_BUILD) $(PPPOECD_IPK_BUILD_DIR)
51
52 # main target for building the ipk version
53 pppoecd-ipk: $(PPPOECD_PACKAGE)
54
55 # the embedded binary
56 $(PPPOECD_BIN): $(PPPOECD_DIR)/.patched
57 mkdir -p $(TARGET_DIR)/etc/ppp
58 cp $(PPPOECD_IPK_DIR)/root/etc/ppp/ip-up $(TARGET_DIR)/etc/ppp/ip-up
59 chmod a+x $(TARGET_DIR)/etc/ppp/ip-up
60 $(MAKE) -C $(PPPOECD_DIR) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld \
61 SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(TARGET_DIR) LIBDIR=$(UCLIBC_DIR)/lib \
62 STRIP="$(STRIP)" \
63 install
64
65 # main target for building the embedded version
66 pppoecd: $(PPPOECD_BIN)
67
68 pppoecd-clean:
69 -$(MAKE) -C $(PPPOECD_DIR) clean
70 rm -f $(TARGET_DIR)/usr/sbin/pppoecd
71 rm -rf $(PPPOECD_IPK_BUILD_DIR)
72 rm -f $(PPPOECD_PACKAGE)
This page took 0.051684 seconds and 5 git commands to generate.