component.am 2.49 KB
Newer Older
1 2 3 4 5
dist_gblib_DATA = $(COMPONENT).component
gblib_DATA = $(COMPONENT).component

install-data-hook:
	@$(INSTALL) -d $(DESTDIR)$(gbdatadir)/info
Sebastian Kulesz's avatar
Sebastian Kulesz committed
6
	@rm -f $(DESTDIR)$(gblibdir)/$(COMPONENT).gambas;
Benoît Minisini's avatar
Benoît Minisini committed
7
	@if test -d $(COMPONENT) && test -e $(COMPONENT)/.project ; then \
Benoît Minisini's avatar
Benoît Minisini committed
8
		echo; \
9 10 11 12 13
		echo "Compiling the $(COMPONENT) project..."; \
		( \
			$(DESTDIR)$(bindir)/gbi$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) $(COMPONENT); \
			cd $(COMPONENT); \
			$(DESTDIR)$(bindir)/gbc$(GAMBAS_VERSION) -ag -r $(DESTDIR)$(prefix); \
Benoît Minisini's avatar
Benoît Minisini committed
14 15 16 17 18 19 20
			if test $$? -eq 0; then \
				$(DESTDIR)$(bindir)/gba$(GAMBAS_VERSION); \
				rm -rf .gambas; \
				$(INSTALL) $(COMPONENT).gambas $(DESTDIR)$(gblibdir); \
			else \
				echo "|| Unable to compile $(COMPONENT)" >> ../../../warnings.log; \
			fi \
21 22
		) \
	fi
Laurent Carlier's avatar
Laurent Carlier committed
23
	@if test -d data; then \
Laurent Carlier's avatar
Laurent Carlier committed
24
		echo "Installing the $(COMPONENT) extra data files..."; \
Laurent Carlier's avatar
Laurent Carlier committed
25 26 27
		$(INSTALL) -d $(DESTDIR)$(gbdatadir)/$(COMPONENT); \
		$(INSTALL) data/* $(DESTDIR)$(gbdatadir)/$(COMPONENT); \
	fi
Benoît Minisini's avatar
Benoît Minisini committed
28
	@echo "Installing the $(COMPONENT) control icons if needed...";
Sebastian Kulesz's avatar
Sebastian Kulesz committed
29
	@rm -rf $(DESTDIR)$(gbdatadir)/control/$(COMPONENT);
Benoît Minisini's avatar
Benoît Minisini committed
30 31 32 33 34
	@if test -d control; then \
		$(INSTALL) -d $(DESTDIR)$(gbdatadir)/control; \
		$(INSTALL) -d $(DESTDIR)$(gbdatadir)/control/$(COMPONENT); \
		$(INSTALL) control/*.png $(DESTDIR)$(gbdatadir)/control/$(COMPONENT); \
	fi
Benoît Minisini's avatar
Benoît Minisini committed
35 36 37 38 39
	@if test -d $(COMPONENT)/.hidden/control; then \
		$(INSTALL) -d $(DESTDIR)$(gbdatadir)/control; \
		$(INSTALL) -d $(DESTDIR)$(gbdatadir)/control/$(COMPONENT); \
		$(INSTALL) $(COMPONENT)/.hidden/control/*.png $(DESTDIR)$(gbdatadir)/control/$(COMPONENT); \
	fi
40
	@echo "Creating the information files for $(COMPONENT) component..."
Benoît Minisini's avatar
Benoît Minisini committed
41 42 43
	@if test "$(EXTRACT_HELP)" = "1"; then \
		$(DESTDIR)$(bindir)/gbh$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) -c $(COMPONENT); \
	fi
Benoît Minisini's avatar
Benoît Minisini committed
44
	@$(DESTDIR)$(bindir)/gbi$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) > /dev/null
45 46 47 48 49 50 51 52 53
	@echo

uninstall-hook:
	@if test -d $(COMPONENT); then \
		rm -f $(DESTDIR)$(gblibdir)/$(COMPONENT).gambas; \
	fi
	@rm -rf $(DESTDIR)$(gblibdir)$(COMPONENT).component
	@rm -rf $(DESTDIR)$(gbdatadir)/info/$(COMPONENT).info
	@rm -rf $(DESTDIR)$(gbdatadir)/info/$(COMPONENT).list
Benoît Minisini's avatar
Benoît Minisini committed
54
	@rm -rf $(DESTDIR)$(gbdatadir)/control/$(COMPONENT);
Laurent Carlier's avatar
Laurent Carlier committed
55
	@rm -rf $(DESTDIR)$(gbdatadir)/$(COMPONENT);
56 57 58 59 60 61

dist-hook:
	@if test -d $(COMPONENT); then \
		( \
			cp -pR $(COMPONENT) $(distdir)/$(COMPONENT); \
			cd $(distdir)/$(COMPONENT); \
Benoît Minisini's avatar
Benoît Minisini committed
62
			rm -rf .gambas .action .xvpics */.xvpics */*/.xvpics *~ */*~ */*/*~ *.out .*.out .lang/*.pot *.gambas core.* .svn */.svn */*/.svn */*/*/.svn; \
63 64 65
		) \
	fi
	@rm -f $(distdir)/moc_*.cpp