From: Ben Pfaff Date: Tue, 20 Dec 2005 06:27:07 +0000 (+0000) Subject: Check for the compiler's availability early in the `make' run, in X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22acef028a140604f5b34705263ba70959fcf4f4;p=pintos-anon Check for the compiler's availability early in the `make' run, in Make.config, and give a warning that points to the documentation if we can't find it. Also, modify other Makefiles so that Make.config is only included once, so that the message is only printed once. --- diff --git a/src/Make.config b/src/Make.config index 0a1b46a..910ef12 100644 --- a/src/Make.config +++ b/src/Make.config @@ -18,6 +18,10 @@ LD = i386-elf-ld OBJCOPY = i386-elf-objcopy endif +ifeq ($(strip $(shell command -v $(CC) 2> /dev/null)),) +$(warning *** Compiler ($(CC)) not found. Did you set $$PATH properly? Please refer to the Getting Started section in the documentation for details. ***) +endif + # Compiler and assembler invocation. DEFINES = WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers diff --git a/src/Makefile.userprog b/src/Makefile.userprog index 72e35ce..870aae4 100644 --- a/src/Makefile.userprog +++ b/src/Makefile.userprog @@ -1,7 +1,5 @@ # -*- makefile -*- -include $(SRCDIR)/Make.config - $(PROGS): CPPFLAGS += -I$(SRCDIR)/lib/user -I. # Linker flags. diff --git a/src/examples/Makefile b/src/examples/Makefile index a7bba67..e15f824 100644 --- a/src/examples/Makefile +++ b/src/examples/Makefile @@ -24,4 +24,5 @@ lineup_SRC = lineup.c matmult_SRC = matmult.c recursor_SRC = recursor.c +include $(SRCDIR)/Make.config include $(SRCDIR)/Makefile.userprog