1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | |
---|
5 | @SET_MAKE@ |
---|
6 | srcdir = @srcdir@ |
---|
7 | top_srcdir = @top_srcdir@ |
---|
8 | top_builddir = ../../../../../../.. |
---|
9 | subdir = c/src/exec/score/include/rtems/score |
---|
10 | |
---|
11 | INSTALL = @INSTALL@ |
---|
12 | |
---|
13 | RTEMS_ROOT = $(top_srcdir)/@RTEMS_TOPdir@ |
---|
14 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
15 | |
---|
16 | VPATH = @srcdir@ |
---|
17 | |
---|
18 | # We only build multiprocessing related files if HAS_MP was defined |
---|
19 | MP_PIECES_yes_V = mpci mppkt objectmp threadmp |
---|
20 | MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) |
---|
21 | |
---|
22 | # H_FILES that get installed in the rtems/score subdirectoy |
---|
23 | H_PIECES= address apiext bitfield chain context copyrt coremsg coremutex \ |
---|
24 | coresem heap interr isr object \ |
---|
25 | priority stack states sysstate thread threadq \ |
---|
26 | tod tqdata userext watchdog wkspace |
---|
27 | |
---|
28 | # Use this if compilation in location will be supported |
---|
29 | # H_FILES=$(H_PIECES:%=$(srcdir)/%.h) targopts.h |
---|
30 | |
---|
31 | # FIXME: Work-around |
---|
32 | H_FILES=$(H_PIECES:%=$(srcdir)/%.h) |
---|
33 | TARGOPTS=$(PROJECT_INCLUDE)/rtems/score/targopts.h |
---|
34 | |
---|
35 | SRCS=$(H_FILES) $(TARGOPTS) |
---|
36 | |
---|
37 | include $(RTEMS_ROOT)/make/custom/${RTEMS_BSP}.cfg |
---|
38 | include $(RTEMS_ROOT)/make/leaf.cfg |
---|
39 | |
---|
40 | # |
---|
41 | # Add your list of files to delete here. The config files |
---|
42 | # already know how to delete some stuff, so you may want |
---|
43 | # to just run 'make clean' first to see what gets missed. |
---|
44 | # 'make clobber' already includes 'make clean' |
---|
45 | # |
---|
46 | |
---|
47 | CLEAN_ADDITIONS += $(TARGOPTS) |
---|
48 | CLOBBER_ADDITIONS += |
---|
49 | |
---|
50 | # Until RTEMS_CPU is removed from all the make configuration files, |
---|
51 | # this will need to be here to transform hppa1.1 into hppa1_1 to |
---|
52 | # make it a valid cpp symbol. At some point in the near future, |
---|
53 | # targopts.h should not define RTEMS_CPU. As best I can tell, |
---|
54 | # gcc cpp predefines eliminate the need for RTEMS_CPU_MODEL |
---|
55 | # on some families but not on others. For example, the i386 |
---|
56 | # family does not give us enough information from the predefines. |
---|
57 | RTEMS_CPU_DEFINED=$(subst .,_,$(RTEMS_CPU)) |
---|
58 | |
---|
59 | # make the target dependent options file |
---|
60 | $(TARGOPTS): |
---|
61 | @echo "/* target board dependent options file */" >$@ |
---|
62 | @echo "/* automatically generated -- DO NOT EDIT!! */" >>$@ |
---|
63 | @echo >>$@ |
---|
64 | @echo "#ifndef __TARGET_OPTIONS_h" >>$@ |
---|
65 | @echo "#define __TARGET_OPTIONS_h" >>$@ |
---|
66 | @echo >>$@ |
---|
67 | @echo "#ifdef $(RTEMS_CPU_DEFINED)" >>$@ |
---|
68 | @echo "#undef $(RTEMS_CPU_DEFINED)" >>$@ |
---|
69 | @echo "#endif" >>$@ |
---|
70 | @echo "#define $(RTEMS_CPU_DEFINED) 1" >>$@ |
---|
71 | @echo >>$@ |
---|
72 | @echo "#ifdef $(RTEMS_CPU_MODEL)" >>$@ |
---|
73 | @echo "#undef $(RTEMS_CPU_MODEL)" >>$@ |
---|
74 | @echo "#endif" >>$@ |
---|
75 | @echo "#define $(RTEMS_CPU_MODEL) 1" >>$@ |
---|
76 | @echo >>$@ |
---|
77 | @echo "#ifdef ${RTEMS_BSP}" >>$@ |
---|
78 | @echo "#undef ${RTEMS_BSP}" >>$@ |
---|
79 | @echo "#endif" >>$@ |
---|
80 | @echo "#define ${RTEMS_BSP} 1" >>$@ |
---|
81 | @echo >>$@ |
---|
82 | @$(make-target-options) |
---|
83 | ifeq (${RTEMS_USE_MACROS},yes) |
---|
84 | @echo "#define USE_MACROS 1" >>$@ |
---|
85 | else |
---|
86 | @echo "#define USE_INLINES 1" >>$@ |
---|
87 | endif |
---|
88 | ifeq ($(HAS_MULTIPROCESSING),yes) |
---|
89 | @echo "#define RTEMS_MULTIPROCESSING 1" >>$@ |
---|
90 | endif |
---|
91 | ifeq ($(HAS_POSIX_API),yes) |
---|
92 | @echo "#define RTEMS_POSIX_API 1" >>$@ |
---|
93 | endif |
---|
94 | ifeq ($(RTEMS_USE_NEWLIB),yes) |
---|
95 | @echo "#define RTEMS_NEWLIB 1" >>$@ |
---|
96 | @echo "#define MALLOC_PROVIDED 1" >>$@ |
---|
97 | endif |
---|
98 | @echo >>$@ |
---|
99 | @echo "#endif" >>$@ |
---|
100 | @chmod 755 $@ |
---|
101 | |
---|
102 | all: $(SRCS) |
---|
103 | $(INSTALL_CHANGE) ${H_FILES} $(PROJECT_INCLUDE)/rtems/score |
---|
104 | |
---|
105 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
---|
106 | cd $(top_builddir) \ |
---|
107 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
---|