summaryrefslogtreecommitdiff
path: root/src/hal/user_comps/Submakefile
blob: 883712bfba1482f8c8726dbd0ae0ee41fc21c138 (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
USER_COMP_PY = pyvcp hal_input gladevcp

$(patsubst %, ../bin/%, $(USER_COMP_PY)) : ../bin/%: hal/user_comps/%.py
	@$(ECHO) Syntax checking python script $(notdir $@)
	$(Q)$(PYTHON) -c 'import sys; compile(open(sys.argv[1]).read(), sys.argv[1], "exec")' $<
	$(ECHO) Copying python script $(notdir $@)
	$(Q)(echo '#!$(PYTHON)'; sed '1 { /^#!/d; }' $<) > $@.tmp && chmod +x $@.tmp && mv -f $@.tmp $@

PYTARGETS += $(patsubst %, ../bin/%, $(USER_COMP_PY))

ifdef HAVE_LIBMODBUS3
MODBUSSRCS := hal/user_comps/gs2_vfd.c
MODBUSLDFLAGS := $(GLIB_LIBS) $(LIBMODBUS_LIBS)
MODBUSCCFLAGS := $(GLIB_CFLAGS) $(LIBMODBUS_CFLAGS)
USERSRCS += $(MODBUSSRCS)

 $(call TOOBJSDEPS, $(MODBUSSRCS)) : EXTRAFLAGS += $(MODBUSCCFLAGS)

../bin/gs2_vfd: $(call TOOBJS, $(MODBUSSRCS)) ../lib/liblinuxcnchal.so.0
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) -o $@ $^ $(LDFLAGS) $(MODBUSLDFLAGS)
TARGETS += ../bin/gs2_vfd
endif # HAVE_LIBMODBUS

ifeq ($(HIDRAW_H_USABLE),yes)
SHUTTLEXPRESS_SRC = hal/user_comps/shuttlexpress.c
USERSRCS += $(SHUTTLEXPRESS_SRC)
../bin/shuttlexpress: $(call TOOBJS, $(SHUTTLEXPRESS_SRC)) ../lib/liblinuxcnchal.so.0
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) -o $@ $^
TARGETS += ../bin/shuttlexpress
endif

ifdef HAVE_LIBUSB10
XHC_HB04_SRC = hal/user_comps/xhc-hb04.cc
USERSRCS += $(XHC_HB04_SRC)
$(call TOOBJSDEPS, $(XHC_HB04_SRC)) : EXTRAFLAGS += $(LIBUSB10_CFLAGS)
../bin/xhc-hb04: $(call TOOBJS, $(XHC_HB04_SRC)) ../lib/liblinuxcnchal.so.0 ../lib/liblinuxcncini.so.0
	$(ECHO) Linking $(notdir $@)
	$(Q)$(CC) $(LDFLAGS) -o $@ $^ -lm -lstdc++ $(LIBUSB10_LIBS)
TARGETS += ../bin/xhc-hb04
endif # HAVE_LIBUSB10

../include/%.h: ./hal/user_comps/%.h
	cp $^ $@
../include/%.hh: ./hal/user_comps/%.hh
	cp $^ $@