diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2011-06-02 10:06:24 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2011-06-02 10:06:24 +0200 |
commit | 2d4259cc15df8e20dbb5da2396e0dd39a7d29274 (patch) | |
tree | 07303952a02bf416b26d44d920c35fd4a70372d2 /mk | |
parent | 273a32b37f66e3b9e1dff0f1742e601446262993 (diff) | |
download | embtoolkit-2d4259cc15df8e20dbb5da2396e0dd39a7d29274.tar.gz embtoolkit-2d4259cc15df8e20dbb5da2396e0dd39a7d29274.tar.bz2 embtoolkit-2d4259cc15df8e20dbb5da2396e0dd39a7d29274.tar.xz |
Build system: Improve macro
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r-- | mk/macros.mk | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/mk/macros.mk b/mk/macros.mk index 974aa07..1a41b72 100644 --- a/mk/macros.mk +++ b/mk/macros.mk @@ -436,28 +436,37 @@ endef # define EMBTK_CLEANUP_PKG $(call EMBTK_GENERIC_MESSAGE,"Cleanup $($(1)_NAME)...") - @-if [ "x$($(1)_ETC)" != "x" ]; then \ - cd $(SYSROOT)/etc; rm -rf $($(1)_ETC); \ + @-if [ "x$($(1)_ETC)" != "x" ] && [ -e $(SYSROOT)/etc ]; \ + then \ + cd $(SYSROOT)/etc; rm -rf $($(1)_ETC); \ fi - @-if [ "x$($(1)_BINS)" != "x" ]; then \ - cd $(SYSROOT)/usr/bin; rm -rf $($(1)_BINS); \ + @-if [ "x$($(1)_BINS)" != "x" ] && [ -e $(SYSROOT)/usr/bin ]; \ + then \ + cd $(SYSROOT)/usr/bin; rm -rf $($(1)_BINS); \ fi - @-if [ "x$($(1)_SBINS)" != "x" ]; then \ - cd $(SYSROOT)/usr/sbin; rm -rf $($(1)_SBINS); \ + @-if [ "x$($(1)_SBINS)" != "x" ] && [ -e $(SYSROOT)/usr/sbin ]; \ + then \ + cd $(SYSROOT)/usr/sbin; rm -rf $($(1)_SBINS); \ fi - @-if [ "x$($(1)_INCLUDES)" != "x" ]; then \ - cd $(SYSROOT)/usr/include; rm -rf $($(1)_INCLUDES); \ + @-if [ "x$($(1)_INCLUDES)" != "x" ] && [ -e $(SYSROOT)/usr/include ]; \ + then \ + cd $(SYSROOT)/usr/include; rm -rf $($(1)_INCLUDES); \ fi - @-if [ "x$($(1)_LIBS)" != "x" ]; then \ - cd $(SYSROOT)/usr/$(LIBDIR); rm -rf $($(1)_LIBS); \ + @-if [ "x$($(1)_LIBS)" != "x" ] && [ -e $(SYSROOT)/usr/$(LIBDIR) ]; \ + then \ + cd $(SYSROOT)/usr/$(LIBDIR); rm -rf $($(1)_LIBS); \ fi - @-if [ "x$($(1)_LIBEXECS)" != "x" ]; then \ - cd $(SYSROOT)/usr/$(LIBDIR)/libexec; \ - rm -rf $($(1)_LIBEXECS); \ + @-if [ "x$($(1)_LIBEXECS)" != "x" ] && \ + [ -e $(SYSROOT)/usr/$(LIBDIR)/libexec ]; \ + then \ + cd $(SYSROOT)/usr/$(LIBDIR)/libexec; \ + rm -rf $($(1)_LIBEXECS); \ fi - @-if [ "x$($(1)_PKGCONFIGS)" != "x" ]; then \ - cd $(SYSROOT)/usr/$(LIBDIR)/pkgconfig; \ - rm -rf $($(1)_PKGCONFIGS); \ + @-if [ "x$($(1)_PKGCONFIGS)" != "x" ] && \ + [ -e $(SYSROOT)/usr/$(LIBDIR)/pkgconfig ]; \ + then \ + cd $(SYSROOT)/usr/$(LIBDIR)/pkgconfig; \ + rm -rf $($(1)_PKGCONFIGS); \ fi @-rm -rf $($(1)_BUILD_DIR)* endef |