mirror of
https://github.com/cc65/cc65.git
synced 2025-01-01 03:30:20 +00:00
Replace shell code with GNU Make conditionals and functions
Use `ifeq` to provide two rules for the `avail` target: one that reports an error if any of the symlink targets are missing and one that installs the symlinks for the targets if they're all present.
This commit is contained in:
parent
5c12659cf4
commit
68ce335f59
14
src/Makefile
14
src/Makefile
@ -110,22 +110,16 @@ $(RM) /usr/local/bin/$(prog)
|
||||
|
||||
endef # UNAVAIL_recipe
|
||||
|
||||
define AVAIL_check_prog
|
||||
|
||||
@if [ ! -e ../bin/$(prog) ]; then \
|
||||
echo "failed to locate $(prog), please run make first"; \
|
||||
false; \
|
||||
fi
|
||||
|
||||
endef # AVAIL_check_prog
|
||||
|
||||
install:
|
||||
$(INSTALL) -d $(DESTDIR)$(bindir)
|
||||
$(INSTALL) ../bin/* $(DESTDIR)$(bindir)
|
||||
|
||||
avail:
|
||||
$(foreach prog,$(PROGS),$(AVAIL_check_prog))
|
||||
ifneq ($(patsubst %,../bin/%,$(PROGS)),$(wildcard $(patsubst %,../bin/%,$(PROGS))))
|
||||
$(error executables are missing, please run make first)
|
||||
else
|
||||
$(foreach prog,$(PROGS),$(AVAIL_recipe))
|
||||
endif
|
||||
|
||||
unavail:
|
||||
$(foreach prog,$(PROGS),$(UNAVAIL_recipe))
|
||||
|
Loading…
Reference in New Issue
Block a user