1 | ## |
---|
2 | ## $Id$ |
---|
3 | ## |
---|
4 | |
---|
5 | AUTOMAKE_OPTIONS = foreign 1.4 |
---|
6 | |
---|
7 | include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg |
---|
8 | include $(RTEMS_ROOT)/make/leaf.cfg |
---|
9 | |
---|
10 | # We only build multiprocessing related files if HAS_MP was defined |
---|
11 | MP_H_FILES = mpci.h mppkt.h objectmp.h threadmp.h |
---|
12 | |
---|
13 | # H_FILES that get installed in the rtems/score subdirectoy |
---|
14 | STD_H_FILES = address.h apiext.h bitfield.h chain.h context.h copyrt.h coremsg.h \ |
---|
15 | coremutex.h coresem.h heap.h interr.h isr.h object.h priority.h stack.h \ |
---|
16 | states.h sysstate.h thread.h threadq.h tod.h tqdata.h userext.h \ |
---|
17 | watchdog.h wkspace.h |
---|
18 | TARGOPTS = targopts.h |
---|
19 | |
---|
20 | if HAS_MP |
---|
21 | H_FILES = $(STD_H_FILES) $(TARGOPTS) $(MP_H_FILES) |
---|
22 | else |
---|
23 | H_FILES = $(STD_H_FILES) $(TARGOPTS) |
---|
24 | endif |
---|
25 | |
---|
26 | PREINSTALL_FILES = \ |
---|
27 | $(PROJECT_INCLUDE)/rtems/score \ |
---|
28 | $(H_FILES:%=$(PROJECT_INCLUDE)/rtems/score/%) |
---|
29 | |
---|
30 | $(PROJECT_INCLUDE)/rtems/score: |
---|
31 | @$(mkinstalldirs) $@ |
---|
32 | |
---|
33 | $(PROJECT_INCLUDE)/rtems/score/%.h: %.h |
---|
34 | $(INSTALL_DATA) $< $@ |
---|
35 | |
---|
36 | CLEANFILES += $(TARGOPTS) |
---|
37 | |
---|
38 | # Until RTEMS_CPU is removed from all the make configuration files, |
---|
39 | # this will need to be here to transform hppa1.1 into hppa1_1 to |
---|
40 | # make it a valid cpp symbol. At some point in the near future, |
---|
41 | # targopts.h should not define RTEMS_CPU. As best I can tell, |
---|
42 | # gcc cpp predefines eliminate the need for RTEMS_CPU_MODEL |
---|
43 | # on some families but not on others. For example, the i386 |
---|
44 | # family does not give us enough information from the predefines. |
---|
45 | RTEMS_CPU_DEFINED = $(subst .,_,$(RTEMS_CPU)) |
---|
46 | |
---|
47 | # make the target dependent options file |
---|
48 | $(TARGOPTS): |
---|
49 | @echo "/* target board dependent options file */" >$@ |
---|
50 | @echo "/* automatically generated -- DO NOT EDIT!! */" >>$@ |
---|
51 | @echo >>$@ |
---|
52 | @echo "#ifndef __TARGET_OPTIONS_h" >>$@ |
---|
53 | @echo "#define __TARGET_OPTIONS_h" >>$@ |
---|
54 | @echo >>$@ |
---|
55 | @echo "#ifdef $(RTEMS_CPU_DEFINED)" >>$@ |
---|
56 | @echo "#undef $(RTEMS_CPU_DEFINED)" >>$@ |
---|
57 | @echo "#endif" >>$@ |
---|
58 | @echo "#define $(RTEMS_CPU_DEFINED) 1" >>$@ |
---|
59 | @echo >>$@ |
---|
60 | @echo "#ifdef $(RTEMS_CPU_MODEL)" >>$@ |
---|
61 | @echo "#undef $(RTEMS_CPU_MODEL)" >>$@ |
---|
62 | @echo "#endif" >>$@ |
---|
63 | @echo "#define $(RTEMS_CPU_MODEL) 1" >>$@ |
---|
64 | @echo >>$@ |
---|
65 | @echo "#ifdef @RTEMS_BSP@" >>$@ |
---|
66 | @echo "#undef @RTEMS_BSP@" >>$@ |
---|
67 | @echo "#endif" >>$@ |
---|
68 | @echo "#define @RTEMS_BSP@ 1" >>$@ |
---|
69 | @echo >>$@ |
---|
70 | @$(make-target-options) |
---|
71 | @if test "$(RTEMS_USE_MACROS)" = "yes"; then \ |
---|
72 | echo "#define USE_MACROS 1" >>$@; \ |
---|
73 | else \ |
---|
74 | echo "#define USE_INLINES 1" >>$@; \ |
---|
75 | fi |
---|
76 | @if test "$(HAS_MP)" = "yes"; then \ |
---|
77 | echo "#define RTEMS_MULTIPROCESSING 1" >>$@; \ |
---|
78 | fi |
---|
79 | @if test "$(HAS_POSIX_API)" = "yes"; then \ |
---|
80 | echo "#define RTEMS_POSIX_API 1" >>$@; \ |
---|
81 | fi |
---|
82 | @if test "$(HAS_ITRON_API)" = "yes"; then \ |
---|
83 | echo "#define RTEMS_ITRON_API 1" >>$@; \ |
---|
84 | fi |
---|
85 | @if test "$(RTEMS_USE_NEWLIB)" = "yes"; then \ |
---|
86 | echo "#define RTEMS_NEWLIB 1" >>$@; \ |
---|
87 | echo "#define MALLOC_PROVIDED 1" >>$@; \ |
---|
88 | fi |
---|
89 | @echo >>$@ |
---|
90 | @echo "#endif" >>$@ |
---|
91 | |
---|
92 | all: $(PREINSTALL_FILES) |
---|
93 | |
---|
94 | EXTRA_DIST = $(STD_H_FILES) $(MP_H_FILES) |
---|
95 | |
---|
96 | include $(top_srcdir)/../../../automake/local.am |
---|