File: rules

package info (click to toggle)
mrd6 0.9.5-release-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,308 kB
  • ctags: 3,956
  • sloc: cpp: 25,728; perl: 462; makefile: 281; ansic: 142; sh: 67
file content (63 lines) | stat: -rwxr-xr-x 1,453 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/make -f

# Path to OpenWrt-SDK
OPENWRTBR ?= /opt/openwrt-sdk
ARCH = mipsel

TARGET = mrd6
DESTDIR = /tmp/mrd6

# use -static for ipkg
FULL_STATIC = yes

# compiled modules
MODULES = mld pim console
# used options
OPTIONS = NO_INET6_OPTION
MODULE_OPTIONS =

-include ipkg/rules.local

# ---------- Cross compilation env
OPTIMIZE_FOR_CPU=$(ARCH)
STAGING_DIR=$(OPENWRTBR)/staging_dir_$(ARCH)$(ARCH_FPU_SUFFIX)
# TARGET_CROSS=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-
TARGET_CROSS=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-
CC = $(TARGET_CROSS)gcc
CXX = $(TARGET_CROSS)g++
STRIP = $(TARGET_CROSS)strip

export TARGET DESTDIR FULL_STATIC CC CXX STRIP

CONF_MODULES = $(addprefix --static ,$(MODULES))
CONF_OPTIONS = $(addprefix --option ,$(OPTIONS))
CONF_MODULE_OPTIONS = $(addprefix --module-option ,$(MODULE_OPTIONS))

all: build

configure: configure-stamp

configure-stamp:
	config/base.pl \
		--prefix /usr \
		--optimizations space \
		--support-modules no \
		$(CONF_OPTIONS) $(CONF_MODULE_OPTIONS) $(CONF_MODULES)
	touch configure-stamp

build: configure
	$(MAKE) -C src
	$(MAKE) -C tools/c

clean:
	rm configure-stamp
	$(MAKE) -C src clean

install: build
	$(MAKE) -C src install
	$(MAKE) -C tools/c install

	for f in `find $(DESTDIR) -type f`; do (if file $$f | grep "not stripped" > /dev/null; then ( $(STRIP) --strip-unneeded $$f); fi); done

	mkdir -p $(DESTDIR)/etc/init.d/
	cp -p ipkg/S50mrd6  $(DESTDIR)/etc/init.d/