summaryrefslogtreecommitdiff
path: root/src/emc/usr_intf/gmoccapy/Submakefile
blob: da86993fb736efc89711aadc0e6e0cfe61e86bfa (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
GMOCCAPY_MODULES = dialogs getiniinfo notification player preferences widgets

PYTARGETS += ../bin/gmoccapy ../lib/python/gmoccapy/__init__.py $(patsubst %,../lib/python/gmoccapy/%.py,$(GMOCCAPY_MODULES)) \
	../share/gmoccapy/gmoccapy.glade 

PYI18NSRCS += emc/usr_intf/gmoccapy/gmoccapy.py $(patsubst %,emc/usr_intf/gmoccapy/%.py,$(GMOCCAPY_MODULES)) \
	emc/usr_intf/gmoccapy/gmoccapy.glade 

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

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

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

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