File: Makefile

package info (click to toggle)
yorick 1.5.08-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,508 kB
  • ctags: 7,937
  • sloc: ansic: 75,604; cpp: 1,282; lisp: 1,217; sh: 1,026; makefile: 616; fortran: 19
file content (168 lines) | stat: -rw-r--r-- 5,500 bytes parent folder | download
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
SHELL=/bin/sh
MAKE=make
include ../Make.cfg

CFLAGS=$(COPTIONS) -I. -I../gist -I../play
X11LIB=$(XLIB) -lX11
CCLOAD=$(CC) $(LDOPTIONS) $(LDFLAGS)

REQ_DIRS=gist fft matrix
PKG_DIRS=$(REQ_DIRS) $(OPT_DIRS)
ALL_OPTS=drat hex

PKG_I=
PKG_LIBS=
SYS_LIBS=$(X11LIB) $(MATHLIB) $(FPELIB)
ALL_LIBS=$(PKG_LIBS) -L. -lyor $(SYS_LIBS)
D_Y_VERSION='-DY_VERSION="$(Y_VERSION)"'

STD_PKGS=../i0/graph.i ../i0/matrix.i ../i0/fft.i
MAIN_OBJS=main.o yinit.o

OBJS = task.o yorick.o yinput.o parse.o ydata.o yio.o fnctn.o array.o \
  range.o ops.o ops0.o ops1.o ops2.o ops3.o opsv.o nonc.o debug.o \
  std0.o std1.o std2.o ascio.o defmem.o yhash.o  yrdwr.o bcast.o \
  binio.o binobj.o binstd.o cache.o convrt.o binpdb.o clog.o \
  graph.o graph0.o style.o list.o pathfun.o fortrn.o ywrap.o

CLEAN_CRUFT=main.c ycode.c codger yorick pkg-*
PKG_MAKE=CODGER=../yorick/codger YORINCL=-I../yorick PLAYINCL=-I../play \
  C_OPTIMIZE="$(COPTIONS)" libyor
PKG_NUKE=MAKE_TEMPLATE=../Make.cfg yorclean
PKG_CLEAN=ZAP_DOTI= $(PKG_NUKE)

all: yorexe

libyor: codger
	@rm -f pkg-lib pkg-i; touch pkg-lib pkg-i
	@for d in $(PKG_DIRS); do ( cd ../$$d; $(MAKE) $(PKG_MAKE); ); done
	@p=`cat pkg-lib`; echo $$p >pkg-lib1
	@p=`cat pkg-i`; echo $$p >pkg-i1
	@echo ------------------ packages: `cat pkg-i1`
	@echo ------------------ libraries: `cat pkg-lib1`
	@$(MAKE) PKG_LIBS="`cat pkg-lib1`" PKG_I="`cat pkg-i1`" make.done
	@echo ------------------ made libyor target

yorexe: libyor
	@echo ------------------ packages: `cat pkg-i1`
	@echo ------------------ libraries: `cat pkg-lib1`
	@$(MAKE) PKG_LIBS="`cat pkg-lib1`" PKG_I="`cat pkg-i1`" yorick
	@echo ------------------ made yorexe target
	@rm -f pkg-*

make.done: $(OBJS) libyor.a
	$(AR) r libyor.a $(OBJS)
	$(RANLIB) libyor.a
	@touch $@

yorick: libyor.a $(MAIN_OBJS)
	$(CCLOAD) -o $@ $(MAIN_OBJS) $(ALL_LIBS)

check: yorexe
	./yorick -batch testfull.i

config:
	./yconfig.sh

optclean:
	@for d in $(ALL_OPTS); do ( cd ../$$d; $(MAKE) $(PKG_CLEAN); ); done

optnuke:
	@for d in $(ALL_OPTS); do ( cd ../$$d; $(MAKE) $(PKG_NUKE); ); done

clean:: optclean
	rm -f *~ '#'* *.o *.a core a.out cfg.* *.done $(CLEAN_CRUFT)

distclean:: optnuke
	rm -f *~ '#'* *.o *.a core a.out cfg.* *.done $(CLEAN_CRUFT)
	rm -f prmtyp.h Maketmpl Make-cxx .gdbinit

echofc:
	echo "$(FC)" >cfg.tmp

# -------------- auxilliary codes and files ---------------

codger: codger.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(FORTRAN_LINKAGE) -o codger codger.c

ycode.c: codger ../i0/std.i $(STD_PKGS) $(PKG_I)
	./codger $(Y_HOME) $(Y_SITE) $(STD_PKGS) - $(PKG_I)

yinit.o: ycode.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -DYINIT_C -c ycode.c
	mv ycode.o yinit.o

ywrap.o: ycode.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -DYWRAP_C -c ycode.c
	mv ycode.o ywrap.o

main.c: ../play/unix/pmain.c
	cp ../play/unix/pmain.c main.c

../play/all/numfmt:
	@cd ../play; $(MAKE) numfmt

prmtyp.h: ../play/all/numfmt ../play/all/numfmt.c
	../play/all/numfmt prmtyp.h

# ------------- dependencies -------------

# Note: indirectly included headers separated by three spaces
# ydata.h: binio.h hash.h
# binio.h: hash.h
# yio.h: hash.h pstdio.h
# defmem.h: pstdlib.h
# bcast.h: ydata.h   binio.h hash.h

PLAY=../play/play.h
PSLIB=../play/pstdlib.h
PSIO=../play/pstdio.h
PLAYALL=$(PLAY) $(PSLIB) $(PSIO)
HGIST=../gist/gist.h ../gist/hlevel.h

array.o: ydata.h   binio.h hash.h
ascio.o: ydata.h yio.h defmem.h $(PSLIB) $(PLAY)   binio.h hash.h $(PSIO)
bcast.o: bcast.h   ydata.h binio.h hash.h
binio.o: ydata.h yio.h defmem.h $(PSLIB)   binio.h hash.h $(PSIO)
binobj.o: bcast.h defmem.h $(PSLIB)   ydata.h binio.h hash.h
binpdb.o: ydata.h yio.h $(PSLIB)   binio.h hash.h $(PSIO)
binstd.o: binio.h $(PSLIB)   hash.h
cache.o: binio.h $(PSLIB) $(PSIO)   hash.h
clog.o: ydata.h yio.h $(PSLIB)   binio.h hash.h $(PSIO)
convrt.o: binio.h $(PSLIB)   hash.h
debug.o: ydata.h yio.h $(PSLIB) $(PLAY)   binio.h hash.h $(PSIO)
defmem.o: defmem.h   $(PSLIB)
fnctn.o: ydata.h   binio.h hash.h
fortrn.o: fortrn.c yasync.h $(PSLIB)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(FORTRAN_LINKAGE) -c fortrn.c
graph.o: graph.c ydata.h yio.h   binio.h hash.h $(PLAYALL) $(HGIST)
graph0.o: ydata.h   binio.h hash.h
yhash.o: hash.h defmem.h $(PSLIB)
list.o: ydata.h defmem.h   binio.h hash.h
nonc.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) $(NO_HYPOT) -c nonc.c
ops.o: bcast.h $(PSLIB)   ydata.h binio.h hash.h
ops0.o: ydata.h   binio.h hash.h
ops1.o: ydata.h   binio.h hash.h
ops2.o: ydata.h   binio.h hash.h $(PSLIB)
ops3.o: bcast.h $(PSLIB)   ydata.h binio.h hash.h
opsv.o: ydata.h $(PSLIB) prmtyp.h   binio.h hash.h
parse.o: parse.h ydata.h $(PSLIB)   binio.h hash.h
pathfun.o: yio.h $(PSLIB)   hash.h $(PSIO)
range.o: ydata.h   binio.h hash.h
std0.o: std0.c bcast.h yio.h defmem.h $(PSLIB) $(PLAY)   ydata.h binio.h hash.h $(PSIO)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(D_Y_VERSION) -c std0.c
std1.o: ydata.h $(PSLIB) $(PLAY)   binio.h hash.h
std2.o: ydata.h yio.h $(PSLIB) $(PLAY)   binio.h hash.h $(PSIO)
style.o: style.c ydata.h $(PSLIB) $(HGIST) ../gist/draw.h   binio.h hash.h
task.o: ydata.h yio.h $(PSLIB) $(PLAY)   binio.h hash.h $(PSIO)
ydata.o: bcast.h defmem.h $(PSLIB)   ydata.h binio.h hash.h
yinput.o: yio.h parse.h hash.h $(PSLIB) $(PLAY)   $(PSIO)
yio.o: yio.h defmem.h ydata.h $(PSLIB) $(PLAY)   binio.h hash.h $(PSIO)
yorick.o: yorick.c parse.h $(PSLIB) $(PLAY)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(D_NO_STRTOUL) -c yorick.c
yrdwr.o: bcast.h $(PSLIB)   ydata.h binio.h hash.h

# Always compile main.c with -g so new packages can be debugged.
main.o: main.c
	$(CC) $(CPPFLAGS) -I../play -g -c main.c