Commit | Line | Data |
---|---|---|
eb02fd64 | 1 | # |
131a3881 | 2 | # Makefile for directory with subdirs to build. |
eb02fd64 | 3 | # |
131a3881 | 4 | # Last Mod Wed Apr 10 12:24:44 PDT 1991, by rich@sendai |
eb02fd64 RP |
5 | # |
6 | ||
7 | srcdir = . | |
131a3881 | 8 | subdir = Host-$(host)/Target-$(target) |
eb02fd64 | 9 | |
131a3881 RP |
10 | CC = gcc -b$(target) # -B$(srcdir)/../gas/Host-$(host)/Target-$(target)/ |
11 | CFLAGS = -g -nostdinc -nostdlib -I- -I/usr/local/lib/gcc/$(target)/1.92/include -I$(srcdir) -I$(srcdir)/../include -I$(OSINCLUDE) | |
eb02fd64 RP |
12 | |
13 | # These are roughly topologically sorted in order to make porting more | |
14 | # streamlined. | |
15 | ||
16 | SUBDIRS = | |
17 | NONSUBDIRS = | |
18 | SUBDIRS_INCLUDE = machine-dep | |
19 | ||
20 | TARGETLIB = libc.a | |
21 | RANLIB = ranlib | |
131a3881 | 22 | AR = ar cqv |
eb02fd64 RP |
23 | |
24 | #### host and target specific makefile fragments come in here. | |
25 | ||
26 | all: $(TARGETLIB) | |
27 | ||
28 | subdir_do: $(SUBDIRS) $(TARGETDIRS) | |
29 | for i in $(SUBDIRS); \ | |
30 | do \ | |
31 | if (cd $(srcdir)/$$i`if [ -d $(srcdir)/$$i.$(target) ] ; \ | |
32 | then echo .$(target) ; fi`/$(subdir); \ | |
33 | $(MAKE) \ | |
34 | "OSLAYER=../$(OSLAYER)" \ | |
35 | "TARGETLIB=../$(srcdir)/$(subdir)/$(TARGETLIB)" \ | |
131a3881 | 36 | "AR=$(AR)" \ |
eb02fd64 RP |
37 | "RANLIB=$(RANLIB)" $(DO)) ; \ |
38 | then true ; \ | |
39 | else exit 1 ; \ | |
40 | fi ;\ | |
41 | done | |
42 | ||
131a3881 | 43 | $(TARGETLIB): remove-old-copy |
eb02fd64 | 44 | @$(MAKE) subdir_do "DO=all" |
131a3881 RP |
45 | $(RANLIB) $(TARGETLIB) |
46 | ||
47 | remove-old-copy: FORCE | |
48 | rm -f $(TARGETLIB) | |
eb02fd64 RP |
49 | |
50 | oldlibc.a: $(SUBDIRS) FORCE | |
51 | @$(MAKE) subdir_do DO=all | |
52 | rm -rf TEMP | |
53 | mkdir TEMP | |
54 | # Extract files from all subdirs, making sure that none overwrites others. | |
55 | cd TEMP; for i in $(SUBDIRS); do\ | |
56 | ar x ../$$i/library.a;\ | |
57 | chmod a-w *;\ | |
58 | done; | |
59 | # Be sure if interrupted, no libc.a exists. | |
60 | rm -f libc.new | |
61 | cd TEMP; ar cq ../libc.new * | |
62 | ranlib libc.new | |
63 | mv libc.new libc.a | |
64 | rm -rf TEMP | |
65 | ||
66 | clean: | |
67 | rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E | |
68 | $(MAKE) subdir_do DO=clean | |
69 | ||
70 | install: all install_include install_crt install_gnulib install_lib | |
71 | ||
72 | # When installing include files, be sure that machine-dependent | |
73 | # files override machine-independent files. | |
74 | # Might be better to check for collisions? FIXME | |
75 | install_crt: | |
76 | $(MAKE) SUBDIRS=machine-dep DO=install_crt | |
77 | ||
78 | install_gnulib: | |
79 | $(MAKE) SUBDIRS=gnulib DO=install_gnulib | |
80 | ||
81 | install_include: | |
82 | $(MAKE) SUBDIRS=$(SUBDIRS_INCLUDE) DO=install_include | |
83 | ||
84 | install_lib: libc.a | |
85 | cp libc.a $(DESTDIR)/lib/libc.a | |
86 | ||
87 | etags tags: TAGS | |
88 | ||
89 | TAGS: FORCE | |
90 | etags `$(MAKE) ls` | |
91 | ||
92 | ls: | |
93 | @echo Makefile | |
94 | @for i in $(SUBDIRS); \ | |
95 | do \ | |
96 | (cd $$i; \ | |
97 | pwd=`pwd`; \ | |
98 | wd=`basename $$pwd`; \ | |
99 | for j in `$(MAKE) ls`; \ | |
100 | do \ | |
101 | echo $$wd/$$j; \ | |
102 | done) \ | |
103 | done | |
104 | ||
105 | FORCE: | |
106 | ||
107 | # with the gnu make, this is done automatically. | |
108 | ||
109 | Makefile: $(srcdir)/Makefile.in $(srcdir)/configure | |
131a3881 RP |
110 | (cd $(srcdir) ; \ |
111 | ./configure `if [ "$(srcdir)" != "." ] ; then echo +f; fi` -host=$(host) $(target)) | |
eb02fd64 RP |
112 | |
113 | # | |
114 | # $Log$ | |
131a3881 RP |
115 | # Revision 1.3 1991/04/11 02:41:53 rich |
116 | # Cut 2 config. Subdirs. | |
eb02fd64 RP |
117 | # |
118 | # | |
119 | # | |
120 | ||
121 | # end of Makefile.in |