summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 6c738a68e5b4991f748162a15f3cb07482f57f3e (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# $Id: Makefile,v 1.1 2003/04/24 08:06:32 jst Exp $
#
# (c) 2002 by Robert Schwebel <r.schwebel@pengutronix.de>
# (c) 2002 by Jochen Striepe <ptxdist@tolot.escape.de>
#
# For further information about the PTXDIST project see the README file.

PROJECT = PTXdist
VERSION = 0
PATCHLEVEL = 3
SUBLEVEL = 22
EXTRAVERSION =

export PROJECT VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION

MAKE=make
TAR=tar

TOPDIR=$(shell /bin/pwd)
BASENAME=$(shell /usr/bin/basename $(TOPDIR))
BUILDDIR=$(TOPDIR)/build
ROOTDIR=$(TOPDIR)/root
SRCDIR=$(TOPDIR)/src
PTXSRCDIR=$(TOPDIR)/src_ptx
STATEDIR=$(TOPDIR)/state
BOOTDISKDIR=$(TOPDIR)/bootdisk

INSTALL_LOG=$(TOPDIR)/tools/install-log-1.9/install-log

PACKAGES=

export TAR TOPDIR BUILDDIR ROOTDIR SRCDIR PTXSRCDIR STATEDIR PACKAGES

all: help

-include .config 
include $(wildcard rules/*.make)

# install targets 
PACKAGES_TARGETINSTALL 	= $(addsuffix _targetinstall,$(PACKAGES))
PACKAGES_GET		= $(addsuffix _get,$(PACKAGES))
PACKAGES_EXTRACT	= $(addsuffix _extract,$(PACKAGES))
PACKAGES_PREPARE	= $(addsuffix _prepare,$(PACKAGES))
PACKAGES_COMPILE	= $(addsuffix _compile,$(PACKAGES))

help:
# help message {{{
	@echo 
	@echo "PTXDIST - Pengutronix Distribution Build System"
	@echo
	@echo "Syntax:"
	@echo 
	@echo "  make menuconfig       Configure the whole system"
	@echo 
	@echo "  make extract          Extract all needed archives"
	@echo "  make prepare          Prepare the configured system for compilation"
	@echo "  make compile          Compile the packages"
	@echo "  make install          Install to rootdirectory"
	@echo "  make clean            Remove everything but local/"
	@echo "  make rootclean        Remove root directory contents"
	@echo 
	@echo "  make world            Make-everything-and-be-happy"
	@echo
	@echo "Calling these targets affects the whole system. If you want to"
	@echo "do something for a packet do 'make packet-<action>'."
	@echo
	@echo "Available packages and versions: "
	@echo "$(PACKAGES)"
	@echo 
# }}}

get:     $(PACKAGES_GET)
extract: $(PACKAGES_EXTRACT)
prepare: $(PACKAGES_PREPARE)
compile: $(PACKAGES_COMPILE)
install: $(PACKAGES_INSTALL)

world: $(PACKAGES_TARGETINSTALL)

# menuconfig:
# 	CONFIGDIR=$(TOPDIR)/config make -C config/config_system menuconfig

# Configuration system -------------------------------------------------------

scripts/lxdialog/lxdialog:
	make -C scripts/lxdialog lxdialog

scripts/kconfig/libkconfig.so:
	make -C scripts/kconfig libkconfig.so

scripts/kconfig/conf: scripts/kconfig/libkconfig.so
	make -C scripts/kconfig conf

scripts/kconfig/mconf: scripts/kconfig/libkconfig.so
	make -C scripts/kconfig mconf

scripts/kconfig/qconf: scripts/kconfig/libkconfig.so
	make -C scripts/kconfig qconf

menuconfig: scripts/lxdialog/lxdialog scripts/kconfig/mconf
	scripts/kconfig/mconf config/Config.in

xconfig: scripts/kconfig/qconf
	scripts/kconfig/qconf config/Config.in

oldconfig: scripts/kconfig/conf
	scripts/kconfig/conf -o config/Config.in 

# ----------------------------------------------------------------------------

clean: rootclean
	@echo
	@echo -n "cleaning build dir..............."
	@rm -fr $(BUILDDIR)/*
	@echo "done."
	@echo -n "cleaning state dir..............."
	@rm -fr $(STATEDIR)/*
	@echo "done."
	@echo -n "cleaning scripts dir............."
	@make -s -C scripts/kconfig clean
	@make -s -C scripts/lxdialog clean
	@echo "done."
	@echo -n "cleaning bootdisk dir............"
	@rm -fr $(BOOTDISKDIR)/*
	@echo "done."
	@echo
	
rootclean:
	@echo
	@echo -n "cleaning root/ directory........."
	@rm -fr $(ROOTDIR)/*
	@echo "done."
	@echo -n "cleaning state/*.targetinstall..."
	@rm -f $(STATEDIR)/*.targetinstall
	@echo "done."	
	@echo

archive:
	# FIXME: this should be automated
	$(TAR) -C $(TOPDIR)/.. -zcvf /tmp/$(BASENAME).tgz 	\
		--exclude $(BASENAME)/arm-linux/* 		\
		--exclude $(BASENAME)/build/* 			\
		--exclude $(BASENAME)/state/* 			\
		--exclude $(BASENAME)/src/* 			\
		--exclude $(BASENAME)/root/*			\
		--exclude $(BASENAME)/local/*			\
		--exclude $(BASENAME)/src_ptx/busybox*		\
		--exclude $(BASENAME)/bootdisk/*		\
		$(BASENAME)

$(INSTALL_LOG): 
	make -C $(TOPDIR)/tools/install-log-1.9

# vim600:set foldmethod=marker: