-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathSubmakefile
More file actions
91 lines (82 loc) · 3.2 KB
/
Submakefile
File metadata and controls
91 lines (82 loc) · 3.2 KB
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
RTAPIINCS = \
./rtapi/rtapi.h \
./rtapi/rtapi_app.h \
./rtapi/rtapi_atomic.h \
./rtapi/rtapi_bitops.h \
./rtapi/rtapi_bool.h \
./rtapi/rtapi_byteorder.h \
./rtapi/rtapi_ctype.h \
./rtapi/rtapi_device.h \
./rtapi/rtapi_errno.h \
./rtapi/rtapi_firmware.h \
./rtapi/rtapi_gfp.h \
./rtapi/rtapi_io.h \
./rtapi/rtapi_limits.h \
./rtapi/rtapi_list.h \
./rtapi/rtapi_math.h \
./rtapi/rtapi_math_i386.h \
./rtapi/rtapi_math64.h \
./rtapi/rtapi_mutex.h \
./rtapi/rtapi_parport.h \
./rtapi/rtapi_pci.h \
./rtapi/rtapi_slab.h \
./rtapi/rtapi_stdint.h \
./rtapi/rtapi_string.h \
./rtapi/rtapi_vsnprintf.h
# The rtapi headers are needed for halcompile/RT-components
$(patsubst ./rtapi/%,../include/%,$(RTAPIINCS)): ../include/%.h: ./rtapi/%.h
cp $^ $@
ifeq ($(BUILD_SYS),uspace)
RTAPI_APP_SRCS := \
rtapi/uspace_rtapi_main.cc \
rtapi/uspace_rtapi_app.cc \
rtapi/uspace_rtapi_parport.cc \
rtapi/uspace_rtapi_string.c \
rtapi/rtapi_pci.cc
USERSRCS += $(RTAPI_APP_SRCS)
$(call TOOBJSDEPS, rtapi/rtapi_pci.cc): EXTRAFLAGS += $(LIBUDEV_CFLAGS)
$(call TOOBJSDEPS, $(RTAPI_APP_SRCS)): EXTRAFLAGS += -DSIM \
-UULAPI -DRTAPI -pthread
../bin/rtapi_app: $(call TOOBJS, $(RTAPI_APP_SRCS))
$(ECHO) Linking $(notdir $@)
$(Q)$(CXX) -rdynamic -o $@ $^ $(LIBDL) -pthread -lrt $(LIBUDEV_LIBS) -ldl $(LDFLAGS)
TARGETS += ../bin/rtapi_app
endif
USPACE_POSIX_SRCS := rtapi/uspace_posix.cc
USERSRCS += $(USPACE_POSIX_SRCS)
$(call TOOBJSDEPS, $(USPACE_POSIX_SRCS)): EXTRAFLAGS += -pthread -fPIC
../lib/libuspace-posix.so.0: $(call TOOBJS, $(USPACE_POSIX_SRCS))
$(ECHO) Linking $(notdir $@)
$(Q)$(CXX) -shared $(LDFLAGS) -o $@ $^ -Wl,-soname,$(notdir $@)
TARGETS += ../lib/libuspace-posix.so.0
TARGETS += ../lib/libuspace-posix.so
ifeq ($(CONFIG_USPACE_RTAI),y)
USPACE_RTAI_SRCS := rtapi/uspace_rtai.cc
USERSRCS += $(USPACE_RTAI_SRCS)
$(call TOOBJSDEPS, $(USPACE_RTAI_SRCS)): EXTRAFLAGS += -pthread -fPIC $(filter-out -Wstrict-prototypes,$(RTAI_LXRT_CFLAGS))
../lib/libuspace-rtai.so.0: $(call TOOBJS, $(USPACE_RTAI_SRCS))
$(ECHO) Linking $(notdir $@)
$(Q)$(CXX) -shared $(LDFLAGS) -o $@ $^ $(RTAI_LXRT_LDFLAGS) -Wl,-soname,$(notdir $@)
TARGETS += ../lib/libuspace-rtai.so.0
TARGETS += ../lib/libuspace-rtai.so
endif
ifeq ($(CONFIG_USPACE_XENOMAI),y)
USPACE_XENOMAI_SRCS := rtapi/uspace_xenomai.cc
USERSRCS += $(USPACE_XENOMAI_SRCS)
$(call TOOBJSDEPS, $(USPACE_XENOMAI_SRCS)): EXTRAFLAGS += -fPIC $(XENOMAI_CFLAGS)
../lib/libuspace-xenomai.so.0: $(call TOOBJS, $(USPACE_XENOMAI_SRCS))
$(ECHO) Linking $(notdir $@)
$(Q)$(CXX) -shared $(LDFLAGS) -o $@ $^ $(XENOMAI_LDFLAGS) -Wl,-soname,$(notdir $@)
TARGETS += ../lib/libuspace-xenomai.so.0
TARGETS += ../lib/libuspace-xenomai.so
endif
ifeq ($(CONFIG_USPACE_XENOMAI_EVL),y)
USPACE_XENOMAI_EVL_SRCS := rtapi/uspace_xenomai_evl.cc
USERSRCS += $(USPACE_XENOMAI_EVL_SRCS)
$(call TOOBJSDEPS, $(USPACE_XENOMAI_EVL_SRCS)): EXTRAFLAGS += -fPIC $(XENOMAI_EVL_CFLAGS)
../lib/libuspace-xenomai-evl.so.0: $(call TOOBJS, $(USPACE_XENOMAI_EVL_SRCS))
$(ECHO) Linking $(notdir $@)
$(Q)$(CXX) -shared $(LDFLAGS) -o $@ $^ $(XENOMAI_EVL_LDFLAGS) -Wl,-soname,$(notdir $@)
TARGETS += ../lib/libuspace-xenomai-evl.so.0
TARGETS += ../lib/libuspace-xenomai-evl.so
endif