Skip to content

Commit

Permalink
Add check for imagemagick
Browse files Browse the repository at this point in the history
Provide a hint to user if it is not installed.
  • Loading branch information
schodet committed Aug 31, 2013
1 parent a9456e2 commit 906b4f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions lms2012/lmssrc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.dirstamp
.dirstamp_install
.convert-check
*/*/
!adk/*/
*/*.raf
1 change: 1 addition & 0 deletions lms2012/lmssrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ uninstall: $(SUBDIRS:%=%.uninstall) $(SUBDIRS_DISABLED:%=%.uninstall)
$(MAKE) -C $(call space,$*) uninstall

clean: $(SUBDIRS:%=%.clean) $(SUBDIRS_DISABLED:%=%.clean)
rm -f .convert-check

%.clean:
$(MAKE) -C $(call space,$*) clean
Expand Down
14 changes: 12 additions & 2 deletions lms2012/lmssrc/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $(foreach program,$(PROGRAMS_TASM),\
$(eval $(call PROGRAM_TASM_rule,$(program))))

define GRAPHIC_rule
$$(call space,$$(APP)/$1).rgf: $$(call space,$2).bmp .dirstamp
$$(call space,$$(APP)/$1).rgf: $$(call space,$2).bmp .dirstamp | ../.convert-check
$$(BMP_TO_XBM) "$$<" bitmap.xbm
$$(XBM_TO_RGF) bitmap "$$(basename $$@)"
$$(call space,$$(foreach to,$$(INSTALL_TO),$$(INSTALL_DIR_$$(to))/$1.rgf)): $$(call space,$$(APP)/$1).rgf .dirstamp_install
Expand All @@ -80,7 +80,7 @@ $(foreach graphic,$(GRAPHICS),\
$(if $($(graphic)_SOURCE),$($(graphic)_SOURCE),$(graphic)))))

define GRAPHIC_XBM_rule
$$(call space,$$(APP)/$1).xbm: $$(call space,$2).bmp .dirstamp
$$(call space,$$(APP)/$1).xbm: $$(call space,$2).bmp .dirstamp | ../.convert-check
$$(BMP_TO_XBM) "$$<" "$$@"
$$(call space,$$(foreach to,$$(INSTALL_TO),$$(INSTALL_DIR_$$(to))/$1.xbm)): $$(call space,$$(APP)/$1).xbm .dirstamp_install
cp "$$<" "$$@"
Expand Down Expand Up @@ -109,6 +109,16 @@ else
endif
touch $@

../.convert-check:
@if ! which $(BMP_TO_XBM) > /dev/null; then \
echo "##################" >&2; \
echo "# Can not find $(BMP_TO_XBM), please install imagemagick package." >&2; \
echo "##################" >&2; \
echo >&2; \
else \
touch $@; \
fi

$(LMS_TO_RBF_DEPS): ../adk/lmsasm/%: ../../lms2012/source/%
cp $< $@
$(TASM_DEPS): ../adk/lmststasm/%: ../../lms2012/source/%
Expand Down

0 comments on commit 906b4f8

Please sign in to comment.