Makefile.am 3.49 KB
Newer Older
julien.delange's avatar
julien.delange committed
1
2
AUTOMAKE_OPTIONS = no-dependencies

3
4
C_FILES = $(srcdir)/1553.c $(srcdir)/ip.c $(srcdir)/serial.c	\
	    $(srcdir)/spacewire.c $(srcdir)/bluetooth.c
5

6
7
ASN_FILES = $(srcdir)/1553.asn $(srcdir)/ip.asn $(srcdir)/serial.asn	\
	    $(srcdir)/spacewire.asn $(srcdir)/bluetooth.asn
8

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

$(srcdir)/1553.c:
12
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ 1553.asn
13
14
	sed -e 's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g' 1553.h > 1553new.h
	mv 1553new.h 1553.h
15
16
17
	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
18
	mv 1553new.c 1553.c
julien.delange's avatar
julien.delange committed
19
20
21
22
	mv 1553.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

$(srcdir)/spacewire.c:
23
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ spacewire.asn
24
25
	sed -e 's/Spacewire\_Conf\_T/spacewire\_conf\_t/g' spacewire.h > spacewirenew.h
	mv spacewirenew.h spacewire.h
26
27
28
	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
29
	mv spacewirenew.c spacewire.c
julien.delange's avatar
julien.delange committed
30
31
32
33
	mv spacewire.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

$(srcdir)/ip.c:
34
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ ip.asn
julien.delange's avatar
julien.delange committed
35
	mv asn1crt.h ../../../include/drivers/configuration/
36
37
	sed -e 's/IP\_Conf\_T/ip\_conf\_t/g' ip.h > ipnew.h
	mv ipnew.h ip.h
38
39
40
	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
41
42
	mv ipnew.c ip.c
	mv ip.h ../../../include/drivers/configuration/
julien.delange's avatar
julien.delange committed
43
44

$(srcdir)/serial.c:
45
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ serial.asn
46
47
	sed -e 's/Serial\_Conf\_T/serial\_conf\_t/g' serial.h > serialnew.h
	mv serialnew.h serial.h
48
49
50
	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
51
	mv serialnew.c serial.c
julien.delange's avatar
julien.delange committed
52
53
54
	mv serial.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

55
56
57
58
59
60
61
62
63
64
65
$(srcdir)/bluetooth.c:
	mono $$(which asn1.exe) -c -typePrefix __po_hi_c_ bluetooth.asn
	sed -e 's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g' bluetooth.h > bluetoothnew.h
	mv bluetoothnew.h bluetooth.h
	echo "#if (defined (__PO_HI_NEED_DRIVER_BLUETOOTH))\n" > bluetoothnew.c
	sed -e 's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g' bluetooth.c >> bluetoothnew.c
	echo "\n#endif" >> bluetoothnew.c
	mv bluetoothnew.c bluetooth.c
	mv bluetooth.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

julien.delange's avatar
julien.delange committed
66
67
68
69
regenerate:
	rm -f $(C_FILES)
	for v in $(C_FILES); do $(MAKE) $$v ; done

julien.delange's avatar
julien.delange committed
70
install-data-local: $(C_FILES) $(ASN_FILES)
julien.delange's avatar
julien.delange committed
71
72
	$(INSTALL) -d $(DESTDIR)$(csrc)
	for f in $(C_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(csrc) ; done
73
	for f in $(ASN_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(csrc) ; done
julien.delange's avatar
julien.delange committed
74
75
76
77

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

78
EXTRA_DIST = $(C_FILES) $(ASN_FILES)
julien.delange's avatar
julien.delange committed
79

80
CLEANFILES = *~