aboutsummaryrefslogtreecommitdiffstats
path: root/src/rtapi/Submakefile
blob: 640db7717bb918db0524358c146713a7a953f2fb (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
INCLUDES += rtapi

$(patsubst ./rtapi/%,../include/%,$(wildcard ./rtapi/*.h)): ../include/%.h: ./rtapi/%.h
	cp $^ $@
$(patsubst ./rtapi/%,../include/%,$(wildcard ./rtapi/*.hh)): ../include/%.hh: ./rtapi/%.hh
	cp $^ $@

ifeq ($(BUILD_SYS),uspace)

RTAPI_APP_SRCS := \
	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) -O0
$(call TOOBJSDEPS, $(RTAPI_APP_SRCS)): EXTRAFLAGS += -DSIM \
	-UULAPI -DRTAPI -pthread
../bin/rtapi_app: $(call TOOBJS, $(RTAPI_APP_SRCS))
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CXX) -rdynamic $(LDFLAGS) -o $@ $^ $(LIBDL) -pthread -lrt $(LIBUDEV_LIBS) -ldl
TARGETS += ../bin/rtapi_app
endif

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
bues.ch cgit interface