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 $@