add some reasonable warnings/errors when PREFIX is empty
This commit is contained in:
54
Makefile
54
Makefile
@@ -4,16 +4,27 @@ ifneq ($(SILENT),s)
|
|||||||
$(info Using Makefile: $(realpath $(firstword $(MAKEFILE_LIST))) $(MAKECMDGOALS))
|
$(info Using Makefile: $(realpath $(firstword $(MAKEFILE_LIST))) $(MAKECMDGOALS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util checkstyle check
|
.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util checkstyle check checkprefix
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
||||||
all install zip:
|
all zip:
|
||||||
@$(MAKE) -C src --no-print-directory $@
|
@$(MAKE) -C src --no-print-directory $@
|
||||||
@$(MAKE) -C libsrc --no-print-directory $@
|
@$(MAKE) -C libsrc --no-print-directory $@
|
||||||
@$(MAKE) -C doc --no-print-directory $@
|
@$(MAKE) -C doc --no-print-directory $@
|
||||||
@$(MAKE) -C util --no-print-directory $@
|
@$(MAKE) -C util --no-print-directory $@
|
||||||
@$(MAKE) -C samples --no-print-directory $@
|
@$(MAKE) -C samples --no-print-directory $@
|
||||||
|
@$(MAKE) checkprefix --no-print-directory
|
||||||
|
|
||||||
|
install:
|
||||||
|
ifndef PREFIX
|
||||||
|
$(error Error: PREFIX must be set for install to work)
|
||||||
|
endif
|
||||||
|
@$(MAKE) -C src --no-print-directory $@
|
||||||
|
@$(MAKE) -C libsrc --no-print-directory $@
|
||||||
|
@$(MAKE) -C doc --no-print-directory $@
|
||||||
|
@$(MAKE) -C util --no-print-directory $@
|
||||||
|
@$(MAKE) -C samples --no-print-directory $@
|
||||||
|
|
||||||
mostlyclean clean:
|
mostlyclean clean:
|
||||||
@$(MAKE) -C src --no-print-directory $@
|
@$(MAKE) -C src --no-print-directory $@
|
||||||
@@ -24,26 +35,39 @@ mostlyclean clean:
|
|||||||
@$(MAKE) -C test --no-print-directory $@
|
@$(MAKE) -C test --no-print-directory $@
|
||||||
@$(MAKE) -C targettest --no-print-directory $@
|
@$(MAKE) -C targettest --no-print-directory $@
|
||||||
|
|
||||||
avail unavail bin:
|
avail unavail:
|
||||||
@$(MAKE) -C src --no-print-directory $@
|
# FIXME: actually not true, PREFIX is ignored?
|
||||||
|
#ifndef PREFIX
|
||||||
|
# $(error Error: PREFIX must be set for avail/unavail to work)
|
||||||
|
#endif
|
||||||
|
@$(MAKE) -C src --no-print-directory $@
|
||||||
|
|
||||||
|
bin:
|
||||||
|
@$(MAKE) -C src --no-print-directory $@
|
||||||
|
@$(MAKE) checkprefix --no-print-directory
|
||||||
|
|
||||||
lib libtest:
|
lib libtest:
|
||||||
@$(MAKE) -C libsrc --no-print-directory $@
|
@$(MAKE) -C libsrc --no-print-directory $@
|
||||||
|
|
||||||
doc html info:
|
doc html info:
|
||||||
@$(MAKE) -C doc --no-print-directory $@
|
@$(MAKE) -C doc --no-print-directory $@
|
||||||
|
|
||||||
samples:
|
samples:
|
||||||
@$(MAKE) -C samples --no-print-directory $@
|
@$(MAKE) -C samples --no-print-directory $@
|
||||||
|
|
||||||
util:
|
util:
|
||||||
@$(MAKE) -C util --no-print-directory $@
|
@$(MAKE) -C util --no-print-directory $@
|
||||||
|
|
||||||
%65:
|
%65:
|
||||||
@$(MAKE) -C src --no-print-directory $@
|
@$(MAKE) -C src --no-print-directory $@
|
||||||
|
|
||||||
%:
|
%:
|
||||||
@$(MAKE) -C libsrc --no-print-directory $@
|
@$(MAKE) -C libsrc --no-print-directory $@
|
||||||
|
|
||||||
|
checkprefix:
|
||||||
|
ifndef PREFIX
|
||||||
|
$(warning Warning: PREFIX is empty - make install will not work)
|
||||||
|
endif
|
||||||
|
|
||||||
# check the code style
|
# check the code style
|
||||||
checkstyle:
|
checkstyle:
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ ifdef CROSS_COMPILE
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
all bin: $(PROGS)
|
all bin: $(PROGS)
|
||||||
|
ifeq ($(MAKELEVEL),0)
|
||||||
|
ifndef PREFIX
|
||||||
|
$(warning Warning: PREFIX is empty - make install will not work)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
mostlyclean:
|
mostlyclean:
|
||||||
$(call RMDIR,../wrk)
|
$(call RMDIR,../wrk)
|
||||||
|
|||||||
Reference in New Issue
Block a user