Hi, I hope I don't ask a FAQ, but I didn't find the answer in the web so I decided to ask here :)
If there is a complex installation thing `foo', like extracting some archive: tar xzf $(srcdir)/$(requiredfiles) -C "$(DESTDIR)$(requiredfilesdir)"/FILES and a conditional complex `feature', someone could write the following invalid Makefile.am: ------------------------------------------------------------------->8======= install-data-local: myinstbase uninstall-local: myuninstbase myinstbase: mkdir -p $(DESTDIR)$(prefix) touch $(DESTDIR)$(prefix)/foo myuninstbase: rm -f $(DESTDIR)$(prefix)/foo -rmdir -p $(DESTDIR)$(prefix) # these rules could be in some include `featureinst.mak': if FEATURE install-data-local: myinstfeature uninstall-local: myuninstfeature myinstfeature: mkdir -p $(DESTDIR)$(prefix) touch $(DESTDIR)$(prefix)/feature myuninstfeature: rm -f $(DESTDIR)$(prefix)/feature -rmdir -p $(DESTDIR)$(prefix) endif =======8<------------------------------------------------------------------- automake-1.6.3 tells: ------------------------------------------------------------------->8======= test/Makefile.am:1: install-data-local defined both conditionally and unconditionally test/Makefile.am:3: uninstall-local defined both conditionally and unconditionally make: *** [Makefile.in] Error 1 =======8<------------------------------------------------------------------- but it does create Makefile (BTW, isn't this a bug?) and it seems to work correctly. Could someone please tell why automake explicitely catches this up and how to do this correctly? Ideally myinstfeature would be defined in some feature.mak (to allow to reuse it across several Makefile.am): ------------------------------------------------------------------->8======= install-data-local: myinstbase uninstall-local: myuninstbase myinstbase: mkdir -p $(DESTDIR)$(prefix) touch $(DESTDIR)$(prefix)/foo myuninstbase: rm -f $(DESTDIR)$(prefix)/foo -rmdir -p $(DESTDIR)$(prefix) include feature.mak if FEATURE # enable by polling deps: install-data-local: myinstfeature uninstall-local: myuninstfeature endif =======8<------------------------------------------------------------------- feature.mak: ------------------------------------------------------------------->8======= myinstfeature: mkdir -p $(DESTDIR)$(prefix) touch $(DESTDIR)$(prefix)/feature myuninstfeature: rm -f $(DESTDIR)$(prefix)/feature -rmdir -p $(DESTDIR)$(prefix) =======8<------------------------------------------------------------------- How to approach this correctly? oki, Steffen About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,850 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail