summaryrefslogtreecommitdiffstats
path: root/c/Makefile.in
blob: 4824deb679fcb13264b3a2aaba7fd6df63c4f189 (plain) (blame)
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
#
#  $Id$
#
# top level directory for RTEMS build tree
# This Makefile is *not* a good example of a directory Makefile.
#

@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
target = @target@
manext = 1
mandir = @mandir@/man$(manext)
program_prefix = @program_prefix@
VPATH=@srcdir@

include $(RTEMS_CUSTOM)
include $(RTEMS_ROOT)/make/directory.cfg

# dubious, but needed by rtems-glom ...
export PROJECT_HOME

SUB_DIRS=build-tools src

# We only make the install point for the KA9Q header files if it is enabled.
LIBKA9Q_yes_V = lib/include/ka9q
LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V)

# We only make the rtems++ install point if it is enabled.
LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++
LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)

# directories to be created in install point
CREATE_DIRS = \
    lib lib/include lib/include/sys lib/include/rtems \
    lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \
    lib/include/netinet lib/include/libc lib/include/libc/sys \
    lib/include/motorola lib/include/zilog \
    $(LIBKA9Q) \
    $(LIBRTEMSCPLUSPLUS) \
    bin samples \
    tests tests/screens tests/screens/sptests \
    tests/screens/psxtests tests/screens/mptests \
    tests/screens/mptests/node1 tests/screens/mptests/node2 \
    build-tools update-tools

# Make all/install must include 'env'
all: env
$(TARGET_VARIANTS): env
$(TARGET_VARIANTS:%=%_install): env 
$(TARGET_VARIANTS:%=%_all): env 

# top level clean/clobber will delete the install points
clean_WRAPUP = $(MAKE) clean_wrapup
clobber_WRAPUP = $(MAKE) clean_wrapup

clean_wrapup: clean_tools clean_dirs clean_modules

.PHONY:	dirs clean_wrapup clean_dirs clean_tools clean_modules env install

#  XXX The link is temporary while switching to -specs options.
dirs:
	-test -d $(PROJECT_ROOT)/c/src/lib/libhwapi && \
	    (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs)
#	-$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%}
	@echo Making directories in build tree ...
	-$(foreach dir,$(CREATE_DIRS), \
	    $(shell $(MKDIR) $(PROJECT_ROOT)/$(RTEMS_BSP)/$(dir)))

distclean: clobber

clean_dirs:
	$(RM) -r $(PROJECT_RELEASE)

clean_tools:
	cd build-tools; $(MAKE) clean

# NOTE: The wildcard on the install should pick up everything except
#       the tests directory.  This significantly minimizes the install size.
install: all
	 -$(MKDIR) $(prefix)/
	 -$(MKDIR) $(prefix)/rtems
	 -$(MKDIR) $(prefix)/rtems/make
	 -$(MKDIR) $(prefix)/rtems/make/compilers
	 -$(MKDIR) $(prefix)/rtems/make/custom
	-rm -rf $(prefix)/rtems/$(RTEMS_BSP)
	cd ../; tar cf - make $(RTEMS_BSP)/[bilsu]* | \
		(cd $(prefix)/rtems; tar xpBf - )
	(echo RTEMS_BSP = $(RTEMS_BSP) ; $(CAT) make/Templates/Makefile.inc ) \
		> $(prefix)/rtems/$(RTEMS_BSP)/Makefile.inc

tests:
	cd src/tests; $(MAKE) all

env:    $(SRCS) dirs