1 #############################################################
5 #############################################################
7 FILE_SOURCE
:=file_
$(FILE_VERSION
).orig.
tar.gz
8 FILE_PATCH
:=file_
$(FILE_VERSION
)-1.diff.gz
9 FILE_SITE
:=$(BR2_DEBIAN_MIRROR
)/debian
/pool
/main
/f
/file
10 FILE_SOURCE_DIR
:=$(BUILD_DIR
)/file-
$(FILE_VERSION
)
11 FILE_DIR1
:=$(TOOL_BUILD_DIR
)/file-
$(FILE_VERSION
)-host
12 FILE_DIR2
:=$(BUILD_DIR
)/file-
$(FILE_VERSION
)-target
15 FILE_TARGET_BINARY
:=usr
/bin
/file
17 ifneq ($(FILE_PATCH
),)
18 FILE_PATCH_FILE
:=$(DL_DIR
)/$(FILE_PATCH
)
20 $(WGET
) -P
$(DL_DIR
) $(FILE_SITE
)/$(FILE_PATCH
)
22 $(DL_DIR
)/$(FILE_SOURCE
): $(FILE_PATCH_FILE
)
23 $(WGET
) -P
$(DL_DIR
) $(FILE_SITE
)/$(FILE_SOURCE
)
25 #############################################################
27 # build file for use on the host system
29 #############################################################
30 $(FILE_DIR1
)/.configured
: $(FILE_SOURCE_DIR
)/.unpacked
32 (cd
$(FILE_DIR1
); rm -rf config.cache
; \
33 CC
="$(HOSTCC) $(HOST_CFLAGS)" \
34 $(FILE_SOURCE_DIR
)/configure \
35 --prefix=$(FILE_DIR1
)/install \
39 $(TOOL_BUILD_DIR
)/bin
/file
: $(FILE_DIR1
)/.configured
40 $(MAKE
) -C
$(FILE_DIR1
) install
41 ln
-sf
$(FILE_DIR1
)/install/bin
/file
$(TOOL_BUILD_DIR
)/bin
/file
43 host-file
: $(TOOL_BUILD_DIR
)/bin
/file
46 -$(MAKE
) -C
$(FILE_DIR1
) clean
49 rm -rf
$(FILE_DIR1
) $(FILE_SOURCE_DIR
)
51 #############################################################
53 # build file for use on the target system
55 #############################################################
56 file-unpacked
: $(FILE_SOURCE_DIR
)/.unpacked
57 $(FILE_SOURCE_DIR
)/.unpacked
: $(DL_DIR
)/$(FILE_SOURCE
)
58 $(FILE_CAT
) $(DL_DIR
)/$(FILE_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
59 ifneq ($(FILE_PATCH
),)
60 (cd
$(FILE_SOURCE_DIR
) && $(FILE_CAT
) $(FILE_PATCH_FILE
) | patch
-p1
)
61 if
[ -d
$(FILE_SOURCE_DIR
)/debian
/patches
]; then \
62 toolchain
/patch-kernel.sh
$(FILE_SOURCE_DIR
) $(FILE_SOURCE_DIR
) debian
/patches
/\?\?\?-\
*.dpatch
; \
65 toolchain
/patch-kernel.sh
$(FILE_SOURCE_DIR
) package
/file
/ file\
*.patch
66 $(CONFIG_UPDATE
) $(@D
)
67 $(SED
) 's/-O2//g' $(@D
)/configure
70 $(FILE_DIR2
)/.configured
: THIS_SRCDIR
= $(FILE_SOURCE_DIR
)
71 $(FILE_DIR2
)/.configured
: $(FILE_SOURCE_DIR
)/.unpacked
73 (cd
$(FILE_DIR2
); rm -rf config.cache
; \
74 $(AUTO_CONFIGURE_TARGET
) \
78 --datadir=/usr
/share
/misc \
79 --localstatedir
=/var \
80 --mandir=/usr
/share
/man \
81 --infodir=/usr
/share
/info \
83 $(DISABLE_LARGEFILE
) \
85 --disable-fsect-man5 \
89 $(FILE_DIR2
)/$(FILE_BINARY
): $(FILE_DIR2
)/.configured
$(TOOL_BUILD_DIR
)/bin
/file
90 # Make sure that we find the correct binary to create our magic..
91 ln
-sf
$(TOOL_BUILD_DIR
)/bin
/file
$(FILE_DIR2
)/magic
/file
92 $(MAKE
) -C
$(FILE_DIR2
)
94 $(TARGET_DIR
)/$(FILE_TARGET_BINARY
): $(FILE_DIR2
)/$(FILE_BINARY
)
95 $(MAKE
) -C
$(FILE_DIR2
) \
96 DESTDIR
=$(TARGET_DIR
) FILE_COMPILE
=$(TOOL_BUILD_DIR
)/bin
/file \
98 -$(STRIPCMD
) $(STRIP_STRIP_UNNEEDED
) $(TARGET_DIR
)/usr
/lib
/libmagic.so.
*.
*
99 ifneq ($(BR2_HAVE_INFOPAGES
),y
)
100 rm -rf
$(TARGET_DIR
)/usr
/share
/info
102 ifneq ($(BR2_HAVE_MANPAGES
),y
)
103 rm -rf
$(TARGET_DIR
)/usr
/share
/man
105 rm -rf
$(TARGET_DIR
)/usr
/share
/locale
106 rm -rf
$(TARGET_DIR
)/usr
/share
/doc
107 mv
$(TARGET_DIR
)/usr
/lib
/libmagic.a
$(STAGING_DIR
)/usr
/lib
108 rm -f
$(TARGET_DIR
)/lib
/libmagic.la
109 mv
$(TARGET_DIR
)/usr
/include/magic.h
$(STAGING_DIR
)/usr
/include
111 file
: zlib uclibc
$(TARGET_DIR
)/$(FILE_TARGET_BINARY
)
113 file-source
: $(DL_DIR
)/$(FILE_SOURCE
)
116 -$(MAKE
) DESTDIR
=$(TARGET_DIR
) CC
=$(TARGET_CC
) -C
$(FILE_DIR2
) uninstall
117 -$(MAKE
) -C
$(FILE_DIR2
) clean
122 #############################################################
124 # Toplevel Makefile options
126 #############################################################
127 ifeq ($(BR2_PACKAGE_FILE
),y
)