[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 | top_srcdir = @top_srcdir@ |
---|
| 11 | prefix = @prefix@ |
---|
| 12 | exec_prefix = @exec_prefix@ |
---|
| 13 | bindir = @bindir@ |
---|
| 14 | libdir = @libdir@ |
---|
| 15 | includedir = @includedir@ |
---|
| 16 | target = @target@ |
---|
| 17 | manext = 1 |
---|
| 18 | mandir = @mandir@/man$(manext) |
---|
| 19 | program_prefix = @program_prefix@ |
---|
| 20 | VPATH=@srcdir@ |
---|
| 21 | |
---|
| 22 | include $(RTEMS_CUSTOM) |
---|
| 23 | include $(RTEMS_ROOT)/make/directory.cfg |
---|
| 24 | |
---|
| 25 | # dubious, but needed by rtems-glom ... |
---|
| 26 | export PROJECT_HOME |
---|
| 27 | |
---|
| 28 | SUB_DIRS=build-tools src |
---|
| 29 | |
---|
[1f0f3e35] | 30 | # We only make the install point for the KA9Q header files if it is enabled. |
---|
[0c618b67] | 31 | LIBKA9Q_yes_V = lib/include/ka9q |
---|
[1f0f3e35] | 32 | LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V) |
---|
| 33 | |
---|
[91333c2] | 34 | # We only make the rtems++ install point if it is enabled. |
---|
[0c618b67] | 35 | LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++ |
---|
[91333c2] | 36 | LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V) |
---|
| 37 | |
---|
[254b4450] | 38 | # directories to be created in install point |
---|
[0c618b67] | 39 | CREATE_DIRS = \ |
---|
| 40 | lib lib/include lib/include/sys lib/include/rtems \ |
---|
| 41 | lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \ |
---|
| 42 | lib/include/netinet lib/include/libc lib/include/libc/sys \ |
---|
| 43 | lib/include/motorola lib/include/zilog \ |
---|
[7510f18c] | 44 | $(LIBKA9Q) \ |
---|
| 45 | $(LIBRTEMSCPLUSPLUS) \ |
---|
[0c618b67] | 46 | bin samples \ |
---|
[7510f18c] | 47 | tests tests/screens tests/screens/sptests \ |
---|
| 48 | tests/screens/psxtests tests/screens/mptests \ |
---|
| 49 | tests/screens/mptests/node1 tests/screens/mptests/node2 \ |
---|
| 50 | build-tools update-tools |
---|
[254b4450] | 51 | |
---|
| 52 | # Make all/install must include 'env' |
---|
[2a1a547] | 53 | all: env |
---|
| 54 | $(TARGET_VARIANTS): env |
---|
| 55 | $(TARGET_VARIANTS:%=%_install): env |
---|
| 56 | $(TARGET_VARIANTS:%=%_all): env |
---|
[254b4450] | 57 | |
---|
| 58 | # top level clean/clobber will delete the install points |
---|
| 59 | clean_WRAPUP = $(MAKE) clean_wrapup |
---|
| 60 | clobber_WRAPUP = $(MAKE) clean_wrapup |
---|
| 61 | |
---|
| 62 | clean_wrapup: clean_tools clean_dirs clean_modules |
---|
| 63 | |
---|
| 64 | .PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install |
---|
| 65 | |
---|
| 66 | # XXX The link is temporary while switching to -specs options. |
---|
| 67 | dirs: |
---|
[5bb2ed07] | 68 | -test -d $(PROJECT_ROOT)/c/src/lib/libhwapi && \ |
---|
| 69 | (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) |
---|
[254b4450] | 70 | -$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%} |
---|
| 71 | |
---|
| 72 | distclean: clobber |
---|
| 73 | |
---|
| 74 | clean_dirs: |
---|
| 75 | $(RM) -r $(PROJECT_RELEASE) |
---|
| 76 | |
---|
| 77 | clean_tools: |
---|
| 78 | cd build-tools; $(MAKE) clean |
---|
| 79 | |
---|
| 80 | # NOTE: The wildcard on the install should pick up everything except |
---|
| 81 | # the tests directory. This significantly minimizes the install size. |
---|
| 82 | install: all |
---|
| 83 | -$(MKDIR) $(prefix)/$(target) |
---|
| 84 | -$(MKDIR) $(prefix)/$(target)/rtems |
---|
| 85 | -$(MKDIR) $(prefix)/$(target)/rtems/make |
---|
| 86 | -$(MKDIR) $(prefix)/$(target)/rtems/make/compilers |
---|
| 87 | -$(MKDIR) $(prefix)/$(target)/rtems/make/custom |
---|
| 88 | -$(MKDIR) $(prefix)/$(target)/rtems/make/os |
---|
| 89 | -rm -rf $(prefix)/$(target)/rtems/$(RTEMS_BSP) |
---|
[0c618b67] | 90 | cd ../; tar cf - make $(RTEMS_BSP)/[bilsu]* | \ |
---|
[254b4450] | 91 | (cd $(prefix)/$(target)/rtems; tar xpBf - ) |
---|
[0c618b67] | 92 | (echo RTEMS_BSP = $(RTEMS_BSP) ; cat make/Templates/Makefile.inc ) \ |
---|
| 93 | > $(prefix)/$(target)/rtems/$(RTEMS_BSP)/Makefile.inc |
---|
[254b4450] | 94 | |
---|
| 95 | tests: |
---|
| 96 | cd src/tests; $(MAKE) all |
---|
| 97 | |
---|
| 98 | env: $(SRCS) dirs |
---|