summaryrefslogtreecommitdiff
path: root/src/emc/usr_intf/touchy/Submakefile
blob: c4e1a0aab8e01c6368cdfb4be71846319be2b665 (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
TOUCHY_MODULES = mdi emc_interface hal_interface filechooser listing preferences

PYTARGETS += ../bin/touchy ../lib/python/touchy/__init__.py $(patsubst %,../lib/python/touchy/%.py,$(TOUCHY_MODULES)) \
	../share/linuxcnc/touchy.glade
PYI18NSRCS += emc/usr_intf/touchy/touchy.py $(patsubst %,emc/usr_intf/touchy/%.py,$(TOUCHY_MODULES)) \
	emc/usr_intf/touchy/touchy.glade

../lib/python/touchy/__init__.py:
	@mkdir -p ../lib/python/touchy
	@touch $@

../lib/python/touchy/%: emc/usr_intf/touchy/%
	@$(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)mkdir -p ../lib/python/touchy
	$(Q)cp $< $@

../share/linuxcnc/touchy.glade: emc/usr_intf/touchy/touchy.glade
	$(ECHO) Copying glade file $(notdir $@)
	$(Q)mkdir -p $(dir $@)
	$(Q)cp -f $< $@

../bin/touchy: emc/usr_intf/touchy/touchy.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 $@