Makefile.ALL
1.88 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
95
96
97
98
99
100
101
#!gmake
ifndef SIMTOOLS
SIMTOOLS = ../../../..
endif
include $(SIMTOOLS)/makedefs
VPATH = ..
################################################################
# Include Files
################################################################
INCS = -I. -I$(SIMTOOLS) -I$(SIMTOOLS)/common/misc
ifdef SIMOS
DEF1 = -DSIMOS
endif
DEFS = $(DEF1) $(DEF2) $(GLOBAL_DEFS)
CFLAGS += $(GLOBAL_CFLAGS)
LDFLAGS += $(GLOBAL_LDFLAGS)
ifeq ($(CPU),ALPHA)
LDFLAGS+= -lnsl
endif
ifeq ($(CPU),SUN)
LDFLAGS += -lsocket -lnsl
endif
C_TARGETS = rmtaccessserver.o
TARGETS = $(C_TARGETS)
ifdef SIMOS
ifeq ($(CPU),SGI)
GOAL = simos
endif
ifeq ($(CPU),SGIN32)
GOAL = simos
endif
ifeq ($(CPU),ALPHA)
GOAL = simos-alpha
endif
ifeq ($(CPU),SUN)
GOAL = simos-sun
endif
CC_OPTS = $(CFLAGS) $(INCS) $(DEFS)
endif
default: warn
ifdef SIMOS
@$(MAKE) -f ../Makefile.ALL SIMOS=1 deps
@$(MAKE) -f ../Makefile.ALL SIMOS=1 INCLUDE_DEPS=1 $(GOAL)
endif
simos: rmtaccess
simos-sun: rmtaccess-sun
simos-alpha: rmtaccess-alpha
rmtaccess: $(TARGETS)
@echo "-> Building rmtaccess"
$(CC) $(CC_OPTS) -o ../rmtaccess $(TARGETS) $(LDFLAGS)
rmtaccess-sun: $(TARGETS)
@echo "-> Building rmtaccess-sun"
$(CC) $(CC_OPTS) -o ../rmtaccess-sun $(TARGETS) $(LDFLAGS)
rmtaccess-alpha: $(TARGETS)
@echo "-> Building rmtaccess-alpha"
$(CC) $(CC_OPTS) -o ../rmtaccess $(TARGETS) -DSIM_ALPHA $(LDFLAGS)
warn:
@echo ""
@echo "Building rmtaccess"
@echo "***************************"
@echo " DEFS : `$(FORMAT) $(DEFS)`"
@echo " CFLAGS : `$(FORMAT) $(CFLAGS)`"
@echo " INCS : `$(FORMAT) $(INCS)`"
@echo " CPU : `$(FORMAT) $(CPU)`"
@echo ""
$(C_TARGETS): %.o: $(SIMTOOLS)/apps/unix/rmtaccess/%.c
@echo "Compiling $(<F)"
$(CC) $(CC_OPTS) -c $(SIMTOOLS)/apps/unix/rmtaccess/$*.c
deps: ${TARGETS:.o=.d}
%.d: %.c
@echo "Finding dependencies of $(<F)"
@$(CC) -M $(CC_OPTS) $< > $@
ifdef INCLUDE_DEPS
include ${TARGETS:.o=.d}
endif