Makefile.ALL
1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!gmake
ifndef SIMTOOLS
SIMTOOLS = ../../..
endif
include $(SIMTOOLS)/makedefs
TARGET = gammalib.a
VPATH = ..
#################################################################
# INCLUDE DIRECTORIES
#################################################################
ID1 = -I$(SIMTOOLS)/common/misc -I$(SIMTOOLS)/common/stats
ID2 = -I$(SIMTOOLS)/common/tcl
ID3 = -I$(SIMTOOLS)/cpus-alpha/alpha-shared
ID4 = -I$(SIMTOOLS)/simos
ID5 = -I$(SIMTOOLS)/caches
INCS = $(ID1) $(ID2) $(ID3) $(ID4) $(ID5)
#################################################################
# DEFINES
#################################################################
ifdef SOLO
DEF1 = -DSOLO
else
DEF1 = -DSIMOS
endif
DEFS = $(DEF1) $(GLOBAL_DEFS) -DPRINT_INSTRUCTIONS
#################################################################
# C and ASM FLAGS
#################################################################
CFLAGS = $(GLOBAL_CFLAGS)
CC_OPTS = $(CFLAGS) $(INCS) $(DEFS)
#################################################################
# TARGETS
#################################################################
C_TARGETS = ev5.o ipr_decode.o print_insts.o tb.o qc.o \
alpha_params.o stats.o alpha_trace.o alpha_memref.o
TARGETS = $(C_TARGETS)
.PHONY: warn deps
default: warn
ifndef SOLO
@$(MAKE) -f ../Makefile.ALL SIMOS=1 deps
@$(MAKE) -f ../Makefile.ALL SIMOS=1 INCLUDE_DEPS=1 $(TARGET)
else
@$(MAKE) -f ../Makefile.ALL SOLO=1 deps
@$(MAKE) -f ../Makefile.ALL SOLO=1 INCLUDE_DEPS=1 $(TARGET)
endif
$(TARGET): $(TARGETS)
@echo "-> Updating library $(TARGET)"
$(AR) cru $(TARGET) $(TARGETS)
warn:
@echo ""
@echo "Making alpha-shared"
@echo "********************"
@echo " DEFS : `$(FORMAT) $(DEFS)`"
@echo " CFLAGS : `$(FORMAT) $(CFLAGS)`"
@echo " INCS: `$(FORMAT) $(INCS)`"
@echo ""
$(C_TARGETS): %.o: %.c
@echo "Compiling $(<F)"
$(CC) $(CC_OPTS) -c $<
deps: ${TARGETS:.o=.d}
%.d: %.c
@$(CC) -M $(CC_OPTS) $< > $@
ifdef INCLUDE_DEPS
include ${TARGETS:.o=.d}
endif