Use common rules and templates, uniformize package Makefile, split package in sub...
[openwrt.git] / openwrt / package / popt / ipkg / rules
1 #!/usr/bin/make -f
2
3 ifneq ($(strip ${IPKG_RULES_INC}),)
4 include $(IPKG_RULES_INC)
5 endif
6
7 ##
8
9 PKG_VERSION := $(shell cat ./ipkg/version)
10 CURRENT_DIR := $(shell pwd)
11 INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
12
13 unexport INSTALL_DIR
14
15 I_LIBPOPT := ipkg/libpopt
16 I_LIBPOPT_DEV := ipkg/libpopt-dev
17
18 BUILD_DEPS := \
19
20 CONFIGURE_OPTS = \
21 --enable-shared \
22 --enable-static \
23
24 ##
25
26 all: package
27
28
29 .stamp-configured: $(BUILD_DEPS)
30
31 rm -rf config.cache
32 $(TARGET_CONFIGURE_OPTS) \
33 CFLAGS="$(TARGET_CFLAGS)" \
34 am_cv_func_iconv=no \
35 ./configure \
36 --target=$(GNU_TARGET_NAME) \
37 --host=$(GNU_TARGET_NAME) \
38 --build=$(GNU_HOST_NAME) \
39 --program-prefix="" \
40 --program-suffix="" \
41 --prefix=/usr \
42 --exec-prefix=/usr \
43 --bindir=/usr/bin \
44 --datadir=/usr/share \
45 --includedir=/usr/include \
46 --infodir=/usr/share/info \
47 --libdir=/usr/lib \
48 --libexecdir=/usr/lib \
49 --localstatedir=/var \
50 --mandir=/usr/share/man \
51 --sbindir=/usr/sbin \
52 --sysconfdir=/etc \
53 $(DISABLE_LARGEFILE) \
54 $(DISABLE_NLS) \
55 $(CONFIGURE_OPTS) \
56
57 touch .stamp-configured
58
59
60 .stamp-built: .stamp-configured
61
62 $(MAKE)
63
64 touch .stamp-built
65
66
67 $(INSTALL_DIR)/usr/include/popt.h: .stamp-built
68
69 mkdir -p $(INSTALL_DIR)
70
71 $(MAKE) \
72 DESTDIR="$(INSTALL_DIR)" \
73 install
74
75 rm -f $(INSTALL_DIR)/usr/lib/libpopt.la
76
77
78 configure: .stamp-configured
79
80
81 build: .stamp-built
82
83
84 install: $(INSTALL_DIR)/usr/include/popt.h
85
86
87 package: $(INSTALL_DIR)/usr/include/popt.h
88
89 mkdir -p $(I_LIBPOPT)/usr/lib
90 cp -fpR $(INSTALL_DIR)/usr/lib/libpopt*.so.* $(I_LIBPOPT)/usr/lib/
91 $(STRIP) $(I_LIBPOPT)/usr/lib/lib*.so.*
92
93 mkdir -p $(I_LIBPOPT_DEV)/usr/include
94 cp -fpR $(INSTALL_DIR)/usr/include/popt.h $(I_LIBPOPT_DEV)/usr/include/
95 mkdir -p $(I_LIBPOPT_DEV)/usr/lib
96 cp -fpR $(INSTALL_DIR)/usr/lib/libpopt*.a $(I_LIBPOPT_DEV)/usr/lib/
97 cp -fpR $(INSTALL_DIR)/usr/lib/libpopt*.so* $(I_LIBPOPT_DEV)/usr/lib/
98
99 chmod 0755 ipkg/*/CONTROL/
100 chmod 0644 ipkg/*/CONTROL/control
101
102 perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
103 ifneq ($(strip $(PKG_VERSION)),)
104 perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
105 endif
106
107 $(IPKG_BUILD) $(I_LIBPOPT) $(IPKG_TARGET_DIR)
108 $(IPKG_BUILD) $(I_LIBPOPT_DEV) $(IPKG_TARGET_DIR)
109
110
111 clean:
112
113 -$(MAKE) \
114 DESTDIR="$(INSTALL_DIR)" \
115 uninstall clean
116
117 rm -rf .stamp-* \
118 $(I_LIBPOPT)/usr \
119 $(I_LIBPOPT_DEV)/usr \
120
121
122 control:
123
124 @cat $(I_LIBPOPT)/CONTROL/control
125 @echo
126 @cat $(I_LIBPOPT_DEV)/CONTROL/control
127 @echo
128
129
130 .PHONY: configure build install package clean control
This page took 0.04889 seconds and 5 git commands to generate.