This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rules.mk
78 lines (62 loc) · 2.04 KB
/
rules.mk
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#################################################################
#
# General
#
#################################################################
TOPDIR:=$(shell pwd)
KERNEL_SOURCE = $(UCLINUX_DIST)/linux-2.6.x
VERSION = 0.2.0
BUILD_DIR = $(TOPDIR)
DL_DIR = $(TOPDIR)/dl
UCLINUX_DIST=$(TOPDIR)/uClinux-dist
STAGING_DIR=$(UCLINUX_DIST)/staging
INCLUDE_DIR=$(TOPDIR)/include
PACKAGE_DIR=$(TOPDIR)/ipkg
PKG_BUILD_DIR=$(TOPDIR)/ipkg
IPKG_STATE_DIR:=$(TOPDIR)/root/usr/lib/ipkg
SCRIPT_DIR=$(TOPDIR)/scripts
TOOLCHAIN_PATH=$(TOPDIR)/opt/uClinux/bfin-linux-uclibc/bin:$(TOPDIR)/opt/uClinux/bfin-uclinux/bin
ARCH=bfin
export PATH:= $(TOOLCHAIN_PATH):$(PATH):scripts:scripts/ipkg-utils:include
export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --
PATCH_KERNEL=$(TOPDIR)/scripts/kernel-patch.sh
TARGET_CROSS=bfin-linux-uclibc-
STRIP=bfin-linux-uclibc-strip
TARGET_STRIP=$(STRIP)
HOSTCC:=gcc
TAR_OPTIONS=-xf
WGET=wget
SVN=svn co
export ROMFSINST:=$(TOPDIR)/scripts/romfs-inst.sh
export CONFIGURE_OPTS=--host=bfin-linux-uclibc \
CFLAGS=-I$(STAGING_DIR)/usr/include \
LDFLAGS=-L$(STAGING_DIR)/usr/lib \
################################################################
# code to support ipkg Makefiles, I can't help thinking using
# makefile code to build ipkgs is doing this the hard way!
# where to build (and put) .ipk packages
IPKG:= \
PATH="$(STAGING_DIR)/bin:$(PATH)" \
IPKG_TMP=$(BUILD_DIR)/tmp \
IPKG_INSTROOT=$(TOPDIR)/root \
IPKG_CONF_DIR=$(STAGING_DIR)/etc \
IPKG_OFFLINE_ROOT=$(TOPDIR)/root \
$(SCRIPT_DIR)/ipkg -force-defaults -force-depends
# invoke ipkg-build with some default options
IPKG_BUILD:= \
ipkg-build -c -o 0 -g 0
# strip an entire directory
RSTRIP:= \
NM="$(TARGET_CROSS)nm" \
STRIP="$(STRIP)" \
STRIP_KMOD="$(TARGET_CROSS)strip --strip-unneeded --remove-section=.comment" \
$(SCRIPT_DIR)/rstrip.sh
#DUMP=0
define shvar
V_$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
endef
define shexport
$(call shvar,$(1))=$$(call $(1))
export $(call shvar,$(1))
endef
include include/package.mk