summaryrefslogtreecommitdiffstats
path: root/cpukit/score/Makefile.am
blob: 2dbc5a9d9522c93e1a74eea46fcf49ac403f3567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
##
## $Id$
##

include $(top_srcdir)/automake/multilib.am
include $(top_srcdir)/automake/compile.am
include $(top_srcdir)/automake/lib.am

SUBDIRS = . cpu

$(PROJECT_INCLUDE):
	@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems:
	@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/score:
	@$(mkinstalldirs) $@

$(PROJECT_INCLUDE)/%.h: include/%.h
	$(INSTALL_DATA) $< $@
$(PROJECT_INCLUDE)/%.inl: $(INLINEdir)/%.inl
	$(INSTALL_DATA) $< $@

PREINSTALL_FILES = $(PROJECT_INCLUDE)
## include

include_rtemsdir = $(includedir)/rtems
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems

include_rtems_HEADERS = include/rtems/debug.h include/rtems/system.h \
    include/rtems/seterr.h

PREINSTALL_FILES += $(include_rtems_HEADERS:include/%=$(PROJECT_INCLUDE)/%)

include_rtems_scoredir = $(includedir)/rtems/score
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score

# We only build multiprocessing related files if HAS_MP was defined
MP_H_FILES = include/rtems/score/mpci.h include/rtems/score/mppkt.h \
    include/rtems/score/objectmp.h include/rtems/score/threadmp.h

# H_FILES that get installed in the rtems/score subdirectoy
STD_H_FILES = include/rtems/score/address.h include/rtems/score/apiext.h \
    include/rtems/score/apimutex.h \
    include/rtems/score/bitfield.h include/rtems/score/chain.h include/rtems/score/context.h \
    include/rtems/score/copyrt.h include/rtems/score/coremsg.h include/rtems/score/coremutex.h \
    include/rtems/score/coresem.h include/rtems/score/heap.h include/rtems/score/interr.h \
    include/rtems/score/isr.h include/rtems/score/object.h include/rtems/score/priority.h \
    include/rtems/score/stack.h include/rtems/score/states.h include/rtems/score/sysstate.h \
    include/rtems/score/thread.h include/rtems/score/threadq.h include/rtems/score/tod.h \
    include/rtems/score/tqdata.h include/rtems/score/userext.h include/rtems/score/watchdog.h \
    include/rtems/score/wkspace.h
include_rtems_score_HEADERS = $(STD_H_FILES) include/rtems/score/cpuopts.h
PREINSTALL_FILES += $(STD_H_FILES:include/%.h=$(PROJECT_INCLUDE)/%.h)

if HAS_MP
include_rtems_score_HEADERS += $(MP_H_FILES)
PREINSTALL_FILES += $(MP_H_FILES:include/%.h=$(PROJECT_INCLUDE)/%.h)
endif

## inline

## We only build multiprocessing related files if HAS_MP was defined
MP_I_FILES = inline/rtems/score/mppkt.inl inline/rtems/score/objectmp.inl inline/rtems/score/threadmp.inl
if INLINE
if HAS_MP
include_rtems_score_HEADERS += $(STD_I_FILES)
PREINSTALL_FILES += $(MP_I_FILES:inline/%.inl=$(PROJECT_INCLUDE)/%.inl)
endif
endif

STD_I_FILES = inline/rtems/score/address.inl inline/rtems/score/chain.inl \
    inline/rtems/score/coremsg.inl inline/rtems/score/coremutex.inl inline/rtems/score/coresem.inl \
    inline/rtems/score/heap.inl inline/rtems/score/isr.inl inline/rtems/score/object.inl \
    inline/rtems/score/priority.inl inline/rtems/score/stack.inl inline/rtems/score/states.inl \
    inline/rtems/score/sysstate.inl inline/rtems/score/thread.inl inline/rtems/score/tod.inl \
    inline/rtems/score/tqdata.inl inline/rtems/score/userext.inl inline/rtems/score/watchdog.inl \
    inline/rtems/score/wkspace.inl
if INLINE
include_rtems_score_HEADERS += $(STD_I_FILES)
PREINSTALL_FILES += $(STD_I_FILES:inline/%.inl=$(PROJECT_INCLUDE)/%.inl)
endif

EXTRA_DIST = $(STD_I_FILES) $(MP_I_FILES)

## macros

## We only build multiprocessing related files if HAS_MP was defined
MP_M_FILES = macros/rtems/score/mppkt.inl macros/rtems/score/objectmp.inl macros/rtems/score/threadmp.inl
if MACROS
if HAS_MP
include_rtems_score_HEADERS += $(MP_M_FILES)
PREINSTALL_FILES += $(MP_M_FILES:macros/%.inl=$(PROJECT_INCLUDE)/%.inl)
endif
endif

STD_M_FILES = macros/rtems/score/address.inl macros/rtems/score/chain.inl \
    macros/rtems/score/coremsg.inl macros/rtems/score/coremutex.inl macros/rtems/score/coresem.inl \
    macros/rtems/score/heap.inl macros/rtems/score/isr.inl macros/rtems/score/object.inl \
    macros/rtems/score/priority.inl macros/rtems/score/stack.inl macros/rtems/score/states.inl \
    macros/rtems/score/sysstate.inl macros/rtems/score/thread.inl macros/rtems/score/tod.inl \
    macros/rtems/score/tqdata.inl macros/rtems/score/userext.inl macros/rtems/score/watchdog.inl \
    macros/rtems/score/wkspace.inl
if MACROS
include_rtems_score_HEADERS += $(STD_M_FILES)
PREINSTALL_FILES += $(MP_M_FILES:inline/%.inl=$(PROJECT_INCLUDE)/%.inl)
endif

EXTRA_DIST += $(STD_M_FILES) $(MP_M_FILES) macros/README

## src

LIB=$(ARCH)/libscore.a

# We only build multiprocessing related files if HAS_MP was defined
MP_C_FILES = src/mpci.c src/objectmp.c src/threadmp.c

CORE_MESSAGE_QUEUE_C_FILES = src/coremsg.c src/coremsgbroadcast.c src/coremsgclose.c \
    src/coremsgflush.c src/coremsgflushwait.c src/coremsginsert.c src/coremsgflushsupp.c \
    src/coremsgseize.c src/coremsgsubmit.c

CORE_MUTEX_C_FILES = src/coremutex.c src/coremutexflush.c src/coremutexseize.c \
    src/coremutexsurrender.c

CORE_SEMAPHORE_C_FILES = src/coresem.c src/coresemflush.c src/coresemseize.c \
    src/coresemsurrender.c

HEAP_C_FILES = src/heap.c src/heapallocate.c src/heapextend.c src/heapfree.c \
    src/heapsizeofuserarea.c src/heapwalk.c src/heapgetinfo.c

OBJECT_C_FILES = src/object.c src/objectallocate.c src/objectallocatebyindex.c \
    src/objectclearname.c src/objectcomparenameraw.c src/objectcomparenamestring.c \
    src/objectcopynameraw.c src/objectcopynamestring.c src/objectextendinformation.c \
    src/objectfree.c src/objectget.c src/objectgetisr.c src/objectgetbyindex.c \
    src/objectgetnext.c src/objectinitializeinformation.c src/objectnametoid.c \
    src/objectshrinkinformation.c src/objectgetnoprotection.c

THREAD_C_FILES = src/thread.c src/threadchangepriority.c src/threadclearstate.c \
    src/threadclose.c src/threadcreateidle.c src/threaddelayended.c src/threaddispatch.c \
    src/threadevaluatemode.c src/threadget.c src/threadhandler.c src/threadidlebody.c \
    src/threadinitialize.c src/threadloadenv.c src/threadready.c src/threadresettimeslice.c \
    src/threadreset.c src/threadrestart.c src/threadresume.c src/threadrotatequeue.c \
    src/threadsetpriority.c src/threadsetstate.c src/threadsettransient.c \
    src/threadstackallocate.c src/threadstackfree.c src/threadstart.c \
    src/threadstartmultitasking.c src/threadsuspend.c src/threadtickletimeslice.c \
    src/threadyieldprocessor.c

THREADQ_C_FILES = src/threadq.c src/threadqdequeue.c src/threadqdequeuefifo.c \
    src/threadqdequeuepriority.c src/threadqenqueue.c src/threadqenqueuefifo.c \
    src/threadqenqueuepriority.c src/threadqextract.c src/threadqextractfifo.c \
    src/threadqextractpriority.c src/threadqextractwithproxy.c src/threadqfirst.c \
    src/threadqfirstfifo.c src/threadqfirstpriority.c src/threadqflush.c src/threadqtimeout.c

TOD_C_FILES = src/coretod.c src/coretodset.c src/coretodtickle.c src/coretodtoseconds.c \
    src/coretodvalidate.c

WATCHDOG_C_FILES = src/watchdog.c src/watchdogadjust.c src/watchdoginsert.c \
    src/watchdogremove.c src/watchdogtickle.c

STD_C_FILES = src/apiext.c src/chain.c $(CORE_MESSAGE_QUEUE_C_FILES) \
    $(CORE_MUTEX_C_FILES) $(CORE_SEMAPHORE_C_FILES) $(HEAP_C_FILES) src/interr.c \
    src/isr.c $(OBJECT_C_FILES) $(THREAD_C_FILES) $(THREADQ_C_FILES) \
    $(TOD_C_FILES) src/userext.c $(WATCHDOG_C_FILES) src/wkspace.c

C_FILES = $(STD_C_FILES)
if HAS_MP
C_FILES += $(MP_C_FILES)
endif
OBJS = $(C_FILES:src/%.c=${ARCH}/%.$(OBJEXT))

#
# Add local stuff here using +=
#

AM_CPPFLAGS += -D__RTEMS_INSIDE__

$(LIB): ${OBJS}
	$(make-library)

${ARCH}/%.$(OBJEXT): src/%.c
	test -d $(ARCH) || mkdir $(ARCH)
	${COMPILE} -o $@ -c $<

EXTRA_DIST += $(STD_C_FILES) $(MP_C_FILES) src/Unlimited.txt

all-local: $(PREINSTALL_FILES) ${ARCH} $(LIB)

include $(top_srcdir)/automake/subdirs.am
include $(top_srcdir)/automake/local.am