From dc6cc1e5f999ffbf1c79d3eb1f91e2e6837622aa Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Sat, 24 Jan 2015 12:09:47 -0500 Subject: [PATCH] Modularize the Makefiles. * It's a good practice to put the main target on top, since it's the first one that is called when calling just "make". That's why "resources", "binaries" and "gettext" were moved up in their Makefile's. * Added a "clean" target for each subdirectories so that they are a bit more autonomous. * Using "&&" instead of ";" when changing directory because if a directory name is changed, we get into an infinite loop. --- Makefile | 13 ++++++------- po/Makefile | 10 +++++++--- resources/Makefile | 7 +++++-- src/Makefile | 7 +++++-- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 290cb94..51c3fbb 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,13 @@ all: - cd resources; make resources - cd src; make binaries - cd po; make gettext + cd resources && make resources + cd src && make binaries + cd po && make gettext clean: - rm -f src/*.c src/pamac-refresh src/pamac-daemon src/pamac-tray src/pamac-updater src/pamac-manager src/pamac-install - rm -f resources/*.c - rm -rf po/locale - rm -f po/*.mo + cd resources && make clean + cd src && make clean + cd po && make clean rm -f data/polkit/org.manjaro.pamac.policy install: diff --git a/po/Makefile b/po/Makefile index 78ed226..ac2324a 100644 --- a/po/Makefile +++ b/po/Makefile @@ -3,10 +3,14 @@ MSGLANGS=$(notdir $(wildcard *.po)) MSGOBJS=$(addprefix locale/,$(MSGLANGS:.po=/LC_MESSAGES/pamac.mo)) +gettext: $(MSGOBJS) + itstool -j ../data/polkit/org.manjaro.pamac.policy.in -o ../data/polkit/org.manjaro.pamac.policy $(MSGLANGS:.po=.mo) + +clean: + rm -rf locale + rm -f *.mo + locale/%/LC_MESSAGES/pamac.mo: %.po msgfmt -c -o $*.mo $*.po mkdir -p $(dir $@) cp $*.mo $(dir $@)pamac.mo - -gettext: $(MSGOBJS) - itstool -j ../data/polkit/org.manjaro.pamac.policy.in -o ../data/polkit/org.manjaro.pamac.policy $(MSGLANGS:.po=.mo) diff --git a/resources/Makefile b/resources/Makefile index 9a31b60..4547f45 100644 --- a/resources/Makefile +++ b/resources/Makefile @@ -33,6 +33,11 @@ INSTALLER_RESOURCES_FILES = progress_dialog.ui \ transaction_sum_dialog.ui \ transaction_info_dialog.ui +resources: manager_resources.c updater_resources.c installer_resources.c + +clean: + rm -f *.c + manager_resources.c: $(MANAGER_GRESOURCE_FILE) $(MANAGER_RESOURCES_FILES) glib-compile-resources $(MANAGER_GRESOURCE_FILE) --target=manager_resources.c --generate-source @@ -41,5 +46,3 @@ updater_resources.c: $(UPDATER_GRESOURCE_FILE) $(UPDATER_RESOURCES_FILES) installer_resources.c: $(INSTALLER_GRESOURCE_FILE) $(INSTALLER_RESOURCES_FILES) glib-compile-resources $(INSTALLER_GRESOURCE_FILE) --target=installer_resources.c --generate-source - -resources: manager_resources.c updater_resources.c installer_resources.c diff --git a/src/Makefile b/src/Makefile index 4dd6910..7c389ca 100644 --- a/src/Makefile +++ b/src/Makefile @@ -29,6 +29,11 @@ DIALOGS_FILES = choose_provider_dialog.vala \ preferences_dialog.vala \ progress_dialog.vala +binaries: pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install + +clean: + rm -f *.c pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install + pamac-refresh: refresh.vala valac -o pamac-refresh \ --pkg=gio-2.0 \ @@ -100,5 +105,3 @@ pamac-install: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(DIALOGS_FILES) ../resour mirrors_config.vala \ transaction.vala \ installer.vala - -binaries: pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install