[254b4450] | 1 | # |
---|
| 2 | # $Id$ |
---|
| 3 | # |
---|
| 4 | # top level directory for RTEMS build tree |
---|
| 5 | # This Makefile is *not* a good example of a directory Makefile. |
---|
| 6 | # |
---|
| 7 | |
---|
| 8 | @SET_MAKE@ |
---|
| 9 | srcdir = @srcdir@ |
---|
| 10 | prefix = @prefix@ |
---|
| 11 | exec_prefix = @exec_prefix@ |
---|
| 12 | bindir = @bindir@ |
---|
| 13 | libdir = @libdir@ |
---|
| 14 | includedir = @includedir@ |
---|
| 15 | target = @target@ |
---|
| 16 | manext = 1 |
---|
| 17 | mandir = @mandir@/man$(manext) |
---|
| 18 | program_prefix = @program_prefix@ |
---|
[674c900] | 19 | VPATH = @srcdir@ |
---|
[5c3511e] | 20 | RTEMS_ROOT = @top_srcdir@ |
---|
[674c900] | 21 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
[254b4450] | 22 | |
---|
[5c3511e] | 23 | include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg |
---|
[254b4450] | 24 | include $(RTEMS_ROOT)/make/directory.cfg |
---|
| 25 | |
---|
| 26 | SUB_DIRS=build-tools src |
---|
| 27 | |
---|
[1f0f3e35] | 28 | # We only make the install point for the KA9Q header files if it is enabled. |
---|
[0c618b67] | 29 | LIBKA9Q_yes_V = lib/include/ka9q |
---|
[1f0f3e35] | 30 | LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V) |
---|
| 31 | |
---|
[91333c2] | 32 | # We only make the rtems++ install point if it is enabled. |
---|
[0c618b67] | 33 | LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++ |
---|
[91333c2] | 34 | LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V) |
---|
| 35 | |
---|
[254b4450] | 36 | # directories to be created in install point |
---|
[0c618b67] | 37 | CREATE_DIRS = \ |
---|
| 38 | lib lib/include lib/include/sys lib/include/rtems \ |
---|
| 39 | lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \ |
---|
| 40 | lib/include/netinet lib/include/libc lib/include/libc/sys \ |
---|
| 41 | lib/include/motorola lib/include/zilog \ |
---|
[7510f18c] | 42 | $(LIBKA9Q) \ |
---|
| 43 | $(LIBRTEMSCPLUSPLUS) \ |
---|
[0c618b67] | 44 | bin samples \ |
---|
[7510f18c] | 45 | tests tests/screens tests/screens/sptests \ |
---|
| 46 | tests/screens/psxtests tests/screens/mptests \ |
---|
| 47 | tests/screens/mptests/node1 tests/screens/mptests/node2 \ |
---|
| 48 | build-tools update-tools |
---|
[254b4450] | 49 | |
---|
| 50 | # Make all/install must include 'env' |
---|
[674c900] | 51 | # if something is added to TARGET_VARIANTS, then account for it here |
---|
[67a2288] | 52 | make_src_makefiles: Makefile.in Makefile |
---|
| 53 | find . -name Makefile -exec grep -q ^preinstall {} \; -print > make_src_makefiles |
---|
| 54 | |
---|
| 55 | pre_install_src: env make_src_makefiles |
---|
| 56 | cd build-tools/scripts; $(MAKE) |
---|
| 57 | CURRDIR=`pwd`; \ |
---|
| 58 | for i in `cat make_src_makefiles` ; do \ |
---|
| 59 | DIR=`dirname $$i`; \ |
---|
| 60 | cd $$DIR; \ |
---|
| 61 | $(MAKE) preinstall; \ |
---|
| 62 | cd $$CURRDIR; \ |
---|
| 63 | done |
---|
| 64 | all: pre_install_src env |
---|
[674c900] | 65 | debug: env |
---|
| 66 | profile: env |
---|
| 67 | |
---|
| 68 | install: all install_files |
---|
| 69 | debug_install: env debug install_files |
---|
| 70 | profile_install: env profile install_files |
---|
| 71 | |
---|
| 72 | debug_all: debug |
---|
| 73 | profile_all: profile |
---|
[254b4450] | 74 | |
---|
| 75 | # top level clean/clobber will delete the install points |
---|
| 76 | clean_WRAPUP = $(MAKE) clean_wrapup |
---|
| 77 | clobber_WRAPUP = $(MAKE) clean_wrapup |
---|
| 78 | |
---|
| 79 | clean_wrapup: clean_tools clean_dirs clean_modules |
---|
| 80 | |
---|
| 81 | .PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install |
---|
| 82 | |
---|
| 83 | dirs: |
---|
[cb5bfe4] | 84 | -$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%} |
---|
[23683dd5] | 85 | if test -d $(PROJECT_ROOT)/c/src/lib/libhwapi; then \ |
---|
| 86 | (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) \ |
---|
| 87 | fi |
---|
[254b4450] | 88 | |
---|
| 89 | distclean: clobber |
---|
| 90 | |
---|
| 91 | clean_dirs: |
---|
| 92 | $(RM) -r $(PROJECT_RELEASE) |
---|
| 93 | |
---|
| 94 | clean_tools: |
---|
| 95 | cd build-tools; $(MAKE) clean |
---|
| 96 | |
---|
[cb5bfe4] | 97 | $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc |
---|
| 98 | echo "RTEMS_BSP = $(RTEMS_BSP)" > $@ |
---|
| 99 | $(CAT) $< >> $@ |
---|
| 100 | |
---|
[254b4450] | 101 | # NOTE: The wildcard on the install should pick up everything except |
---|
| 102 | # the tests directory. This significantly minimizes the install size. |
---|
[674c900] | 103 | |
---|
[cb5bfe4] | 104 | install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc |
---|
| 105 | -$(MKDIR) $(prefix)/ |
---|
| 106 | -$(MKDIR) $(prefix)/rtems |
---|
| 107 | -$(RM) -rf $(prefix)/rtems/$(RTEMS_BSP) |
---|
| 108 | cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \ |
---|
[d7072e5] | 109 | (cd $(prefix)/rtems; tar xpBf - ) |
---|
[16fc1951] | 110 | cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install |
---|
[254b4450] | 111 | |
---|
| 112 | tests: |
---|
| 113 | cd src/tests; $(MAKE) all |
---|
| 114 | |
---|
[275868b6] | 115 | debug_tests: debug |
---|
| 116 | cd src/tests; $(MAKE) debug |
---|
| 117 | |
---|
| 118 | profile_tests: profile |
---|
| 119 | cd src/tests; $(MAKE) profile |
---|
| 120 | |
---|
[254b4450] | 121 | env: $(SRCS) dirs |
---|