[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 |
---|
[2a1a547] | 52 | all: env |
---|
[674c900] | 53 | debug: env |
---|
| 54 | profile: env |
---|
| 55 | |
---|
| 56 | install: all install_files |
---|
| 57 | debug_install: env debug install_files |
---|
| 58 | profile_install: env profile install_files |
---|
| 59 | |
---|
| 60 | debug_all: debug |
---|
| 61 | profile_all: profile |
---|
[254b4450] | 62 | |
---|
| 63 | # top level clean/clobber will delete the install points |
---|
| 64 | clean_WRAPUP = $(MAKE) clean_wrapup |
---|
| 65 | clobber_WRAPUP = $(MAKE) clean_wrapup |
---|
| 66 | |
---|
| 67 | clean_wrapup: clean_tools clean_dirs clean_modules |
---|
| 68 | |
---|
| 69 | .PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install |
---|
| 70 | |
---|
| 71 | dirs: |
---|
[cb5bfe4] | 72 | -$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%} |
---|
[5bb2ed07] | 73 | -test -d $(PROJECT_ROOT)/c/src/lib/libhwapi && \ |
---|
| 74 | (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) |
---|
[674c900] | 75 | # @echo Making directories in build tree ... |
---|
| 76 | # -$(foreach dir,$(CREATE_DIRS), \ |
---|
| 77 | # $(shell $(MKDIR) $(PROJECT_ROOT)/$(RTEMS_BSP)/$(dir))) |
---|
[254b4450] | 78 | |
---|
| 79 | distclean: clobber |
---|
| 80 | |
---|
| 81 | clean_dirs: |
---|
| 82 | $(RM) -r $(PROJECT_RELEASE) |
---|
| 83 | |
---|
| 84 | clean_tools: |
---|
| 85 | cd build-tools; $(MAKE) clean |
---|
| 86 | |
---|
[cb5bfe4] | 87 | $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc |
---|
| 88 | echo "RTEMS_BSP = $(RTEMS_BSP)" > $@ |
---|
| 89 | $(CAT) $< >> $@ |
---|
| 90 | |
---|
[254b4450] | 91 | # NOTE: The wildcard on the install should pick up everything except |
---|
| 92 | # the tests directory. This significantly minimizes the install size. |
---|
[674c900] | 93 | |
---|
[cb5bfe4] | 94 | install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc |
---|
| 95 | -$(MKDIR) $(prefix)/ |
---|
| 96 | -$(MKDIR) $(prefix)/rtems |
---|
| 97 | -$(RM) -rf $(prefix)/rtems/$(RTEMS_BSP) |
---|
| 98 | cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \ |
---|
[d7072e5] | 99 | (cd $(prefix)/rtems; tar xpBf - ) |
---|
[16fc1951] | 100 | cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install |
---|
[254b4450] | 101 | |
---|
| 102 | tests: |
---|
| 103 | cd src/tests; $(MAKE) all |
---|
| 104 | |
---|
| 105 | env: $(SRCS) dirs |
---|