1 |
# $Id$ |
2 |
# John Gerschwitz 28-11-2003 |
3 |
# |
4 |
|
5 |
# |
6 |
# Set default values for local Makefile variables. |
7 |
# |
8 |
|
9 |
# Check ESYS_ROOT has been set. |
10 |
ifeq ($(strip $(ESYS_ROOT)),) |
11 |
ERRORTARGETS += ESYS_ROOT_ERROR |
12 |
ERRORBUILDTARGET := error |
13 |
endif |
14 |
|
15 |
# Some useful definitions |
16 |
NULL := |
17 |
SPACE := ${NULL} ${NULL} |
18 |
SHELL := /bin/sh |
19 |
|
20 |
# Make settings |
21 |
MAKE_DIR := $(ESYS_ROOT)/make |
22 |
|
23 |
# gcc settings |
24 |
ifeq ($(strip $(USE_GCC)),) |
25 |
HOSTNAME := ${shell hostname | sed -e 's/\..*//'} |
26 |
else |
27 |
HOSTNAME := gcc |
28 |
endif |
29 |
|
30 |
# |
31 |
# Set defaults for local variables if not already set |
32 |
# |
33 |
|
34 |
# Current directory |
35 |
ifeq ($(strip $(L_DIR)),) |
36 |
L_DIR := ${shell pwd} |
37 |
endif |
38 |
|
39 |
# Source file directory |
40 |
ifeq ($(strip $(L_SRC_DIR)),) |
41 |
L_SRC_DIR := ./src |
42 |
endif |
43 |
|
44 |
# Library directory |
45 |
ifeq ($(strip $(L_LIB_DIR)),) |
46 |
L_LIB_DIR := ./lib |
47 |
endif |
48 |
|
49 |
# Include file directory |
50 |
ifeq ($(strip $(L_INC_DIR)),) |
51 |
L_INC_DIR := ./inc |
52 |
endif |
53 |
|
54 |
# Object file directory |
55 |
ifeq ($(strip $(L_OBJ_DIR)),) |
56 |
L_OBJ_DIR := ./obj |
57 |
endif |
58 |
|
59 |
# Dependency file directory |
60 |
ifeq ($(strip $(L_DEP_DIR)),) |
61 |
L_DEP_DIR := ./dep |
62 |
endif |
63 |
|
64 |
# Mod file directory |
65 |
ifeq ($(strip $(L_MOD_DIR)),) |
66 |
L_MOD_DIR := ./mod |
67 |
endif |
68 |
|
69 |
# External library directory |
70 |
ifeq ($(strip $(L_EXT_LIB_DIRS)),) |
71 |
L_EXT_LIB_DIRS := ${NULL} |
72 |
endif |
73 |
|
74 |
# External libraries |
75 |
ifeq ($(strip $(L_EXT_LIBS)),) |
76 |
L_EXT_LIBS := ${NULL} |
77 |
endif |
78 |
|
79 |
# External include directories |
80 |
ifeq ($(strip $(L_EXT_INC_DIRS)),) |
81 |
L_EXT_INC_DIRS := ${NULL} |
82 |
endif |
83 |
|
84 |
# External object files |
85 |
ifeq ($(strip $(L_EXT_OBJS)),) |
86 |
L_EXT_OBJS := ${NULL} |
87 |
endif |
88 |
|
89 |
# Packages to link with |
90 |
ifeq ($(strip $(PACKAGES)),) |
91 |
PACKAGES := ${NULL} |
92 |
endif |
93 |
|
94 |
# Do debug compilations or not? |
95 |
ifeq ($(strip $(DODEBUG)),) |
96 |
DODEBUG := NO |
97 |
endif |
98 |
|
99 |
# Library install directory |
100 |
ifeq ($(strip $(L_INSTLIB_DIR)),) |
101 |
L_INSTLIB_DIR := $(ESYS_ROOT)/lib |
102 |
endif |
103 |
|
104 |
# Include remainder of Makefiles |
105 |
include ${MAKE_DIR}/Makefile.source |
106 |
include ${MAKE_DIR}/hosts/${HOSTNAME}/Makefile.host |
107 |
include ${MAKE_DIR}/Makefile.phony |
108 |
include ${MAKE_DIR}/Makefile.package |
109 |
include ${MAKE_DIR}/Makefile.depend |
110 |
include ${MAKE_DIR}/Makefile.implicit |
111 |
|
112 |
# Eliminate default known suffixes |
113 |
.SUFFIXES: |
114 |
|
115 |
# Delete all targets for whom make process fails |
116 |
.DELETE_ON_ERROR: |
117 |
|
118 |
# Define messages to print on specific error conditions |
119 |
error: $(ERRORTARGETS) |
120 |
@echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \ |
121 |
echo "Fatal errors detected.";\ |
122 |
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";\ |
123 |
exit 1 |
124 |
|
125 |
ESYS_ROOT_ERROR: |
126 |
@echo " - ESYS_ROOT variable hasn't been set." |
127 |
|
128 |
NO_SOURCE_FILES_ERROR: |
129 |
@echo "No source files could be found for L_SRC_DIR: $(L_SRC_DIR) |