Makefile.am 3.01 KB
Newer Older
julien.delange's avatar
julien.delange committed
1
2
3
4
5
6
7
AUTOMAKE_OPTIONS = no-dependencies

C_FILES =   $(srcdir)/1553.c       \
            $(srcdir)/ip.c         \
            $(srcdir)/serial.c     \
            $(srcdir)/spacewire.c

8
9
10
11
12
13
ASN_FILES = $(srcdir)/1553.asn       \
            $(srcdir)/ip.asn         \
            $(srcdir)/serial.asn     \
            $(srcdir)/spacewire.asn


julien.delange's avatar
julien.delange committed
14
15
16
csrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/src/drivers/configuration'}

$(srcdir)/1553.c:
yoogx's avatar
yoogx committed
17
	mono $(which asn1.exe) -c -typePrefix __po_hi_c_ 1553.asn
18
19
	sed -e 's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g' 1553.h > 1553new.h
	mv 1553new.h 1553.h
20
21
22
	echo "#if (defined (__PO_HI_NEED_DRIVER_1553_RASTA))\n" > 1553new.c
	sed -e 's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g' 1553.c >> 1553new.c
	echo "\n#endif" >> 1553new.c
23
	mv 1553new.c 1553.c
julien.delange's avatar
julien.delange committed
24
25
26
27
	mv 1553.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

$(srcdir)/spacewire.c:
yoogx's avatar
yoogx committed
28
	mono $(which asn1.exe) -c -typePrefix __po_hi_c_ spacewire.asn
29
30
	sed -e 's/Spacewire\_Conf\_T/spacewire\_conf\_t/g' spacewire.h > spacewirenew.h
	mv spacewirenew.h spacewire.h
31
32
33
	echo "#if (defined (__PO_HI_NEED_DRIVER_SPACEWIRE_RASTA))\n" > spacewirenew.c
	sed -e 's/Spacewire\_Conf\_T/spacewire\_conf\_t/g' spacewire.c >> spacewirenew.c
	echo "\n#endif" >> spacewirenew.c
34
	mv spacewirenew.c spacewire.c
julien.delange's avatar
julien.delange committed
35
36
37
38
	mv spacewire.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

$(srcdir)/ip.c:
yoogx's avatar
yoogx committed
39
	mono $(which asn1.exe) -c -typePrefix __po_hi_c_ ip.asn
julien.delange's avatar
julien.delange committed
40
	mv asn1crt.h ../../../include/drivers/configuration/
41
42
	sed -e 's/IP\_Conf\_T/ip\_conf\_t/g' ip.h > ipnew.h
	mv ipnew.h ip.h
43
44
45
	echo "#if (defined (__PO_HI_NEED_DRIVER_SOCKETS) || defined (__PO_HI_NEED_DRIVER_RTEMS_NE2000_SOCKETS))\n" > ipnew.c
	sed -e 's/IP\_Conf\_T/ip\_conf\_t/g' ip.c >> ipnew.c
	echo "\n#endif" >> ipnew.c
46
47
	mv ipnew.c ip.c
	mv ip.h ../../../include/drivers/configuration/
julien.delange's avatar
julien.delange committed
48
49

$(srcdir)/serial.c:
yoogx's avatar
yoogx committed
50
	mono $(which asn1.exe) -c -typePrefix __po_hi_c_ serial.asn
51
52
	sed -e 's/Serial\_Conf\_T/serial\_conf\_t/g' serial.h > serialnew.h
	mv serialnew.h serial.h
53
54
55
	echo "#if (defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_RECEIVER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_RASTA) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_RECEIVER))\n" > serialnew.c
	sed -e 's/Serial\_Conf\_T/serial\_conf\_t/g' serial.c >> serialnew.c
	echo "\n#endif" >> serialnew.c
56
	mv serialnew.c serial.c
julien.delange's avatar
julien.delange committed
57
58
59
60
61
62
63
	mv serial.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

regenerate:
	rm -f $(C_FILES)
	for v in $(C_FILES); do $(MAKE) $$v ; done

julien.delange's avatar
julien.delange committed
64
install-data-local: $(C_FILES) $(ASN_FILES)
julien.delange's avatar
julien.delange committed
65
66
	$(INSTALL) -d $(DESTDIR)$(csrc)
	for f in $(C_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(csrc) ; done
67
	for f in $(ASN_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(csrc) ; done
julien.delange's avatar
julien.delange committed
68
69
70
71

uninstall-local:
	rm -rf $(DESTDIR)$(csrc)

72
EXTRA_DIST = $(C_FILES) $(ASN_FILES)
julien.delange's avatar
julien.delange committed
73

74
CLEANFILES = *~