]>
Commit | Line | Data |
---|---|---|
04508f14 | 1 | # allow pass CFLAGS, replace -O, -pg,-DPROFILING with $(CFAGS) |
2 | Makefiles=$(find . -type f -name Makefile\*) | |
3 | %{__sed} -i -e 's@^CFLAGS[ \t]*=@override CFLAGS += @' $Makefiles | |
4 | %{__sed} -i -e 's@\(^override CFLAGS += .*\)-O \(.*\)@\1\2@' $Makefiles | |
5 | %{__sed} -i -e 's@^CCFLAGS[ \t]*=\(.*\)@override CCFLAGS += \1 $(CFLAGS)@' $Makefiles | |
6 | %{__sed} -i -e 's@-pg -O -DPROFILING@ $(CFLAGS) @' asmrun/Makefile | |
7 | %{__sed} -i -e 's@-O@$(CFLAGS)@' otherlibs/systhreads/Makefile | |
8 | ||
31cbf6d8 JR |
9 | diff -ur ocaml-3.11.0/asmrun/Makefile ocaml-3.11.0.CFLAGS/asmrun/Makefile |
10 | --- ocaml-3.11.0/asmrun/Makefile 2007-11-15 14:21:15.000000000 +0100 | |
11 | +++ ocaml-3.11.0.CFLAGS/asmrun/Makefile 2009-02-16 12:18:06.599221049 +0100 | |
04508f14 | 12 | @@ -18,9 +18,9 @@ |
13 | CC=$(NATIVECC) | |
14 | FLAGS=-I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE \ | |
31cbf6d8 | 15 | -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(IFLEXDIR) |
04508f14 | 16 | -CFLAGS=$(FLAGS) -O $(NATIVECCCOMPOPTS) |
17 | +override CFLAGS += $(FLAGS) $(NATIVECCCOMPOPTS) | |
18 | DFLAGS=$(FLAGS) -g -DDEBUG $(NATIVECCCOMPOPTS) | |
19 | -PFLAGS=$(FLAGS) -pg -O -DPROFILING $(NATIVECCPROFOPTS) | |
20 | +PFLAGS=$(FLAGS) $(CFLAGS) $(NATIVECCPROFOPTS) | |
21 | ||
31cbf6d8 | 22 | COBJS=startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o \ |
04508f14 | 23 | misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \ |
31cbf6d8 JR |
24 | diff -ur ocaml-3.11.0/asmrun/Makefile.nt ocaml-3.11.0.CFLAGS/asmrun/Makefile.nt |
25 | --- ocaml-3.11.0/asmrun/Makefile.nt 2007-11-15 14:21:15.000000000 +0100 | |
26 | +++ ocaml-3.11.0.CFLAGS/asmrun/Makefile.nt 2009-02-16 12:18:01.212550815 +0100 | |
04508f14 | 27 | @@ -16,7 +16,7 @@ |
28 | include ../config/Makefile | |
29 | ||
30 | CC=$(NATIVECC) | |
31 | -CFLAGS=-I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(NATIVECCCOMPOPTS) | |
32 | +override CFLAGS += -I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(NATIVECCCOMPOPTS) | |
33 | ||
31cbf6d8 | 34 | COBJS=startup.$(O) main.$(O) fail.$(O) roots.$(O) signals.$(O) signals_asm.$(O) \ |
04508f14 | 35 | misc.$(O) freelist.$(O) major_gc.$(O) minor_gc.$(O) memory.$(O) alloc.$(O) \ |
31cbf6d8 JR |
36 | diff -ur ocaml-3.11.0/byterun/Makefile ocaml-3.11.0.CFLAGS/byterun/Makefile |
37 | --- ocaml-3.11.0/byterun/Makefile 2008-11-08 17:29:02.000000000 +0100 | |
38 | +++ ocaml-3.11.0.CFLAGS/byterun/Makefile 2009-02-16 12:18:01.212550815 +0100 | |
39 | @@ -15,7 +15,7 @@ | |
04508f14 | 40 | |
31cbf6d8 JR |
41 | include Makefile.common |
42 | ||
43 | -CFLAGS=-DCAML_NAME_SPACE -O $(BYTECCCOMPOPTS) $(IFLEXDIR) | |
44 | +override CFLAGS += -DCAML_NAME_SPACE $(BYTECCCOMPOPTS) $(IFLEXDIR) | |
04508f14 | 45 | DFLAGS=-DCAML_NAME_SPACE -g -DDEBUG $(BYTECCCOMPOPTS) |
46 | ||
31cbf6d8 JR |
47 | OBJS=$(COMMONOBJS) unix.o main.o |
48 | diff -ur ocaml-3.11.0/byterun/Makefile.nt ocaml-3.11.0.CFLAGS/byterun/Makefile.nt | |
49 | --- ocaml-3.11.0/byterun/Makefile.nt 2008-11-26 14:26:53.000000000 +0100 | |
50 | +++ ocaml-3.11.0.CFLAGS/byterun/Makefile.nt 2009-02-16 12:18:01.215883365 +0100 | |
51 | @@ -15,7 +15,7 @@ | |
04508f14 | 52 | |
31cbf6d8 | 53 | include Makefile.common |
04508f14 | 54 | |
31cbf6d8 JR |
55 | -CFLAGS=-DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR) |
56 | +override CFLAGS += -DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR) | |
04508f14 | 57 | |
31cbf6d8 JR |
58 | DBGO=d.$(O) |
59 | OBJS=$(COMMONOBJS:.o=.$(O)) win32.$(O) main.$(O) | |
60 | diff -ur ocaml-3.11.0/otherlibs/Makefile ocaml-3.11.0.CFLAGS/otherlibs/Makefile | |
61 | --- ocaml-3.11.0/otherlibs/Makefile 2007-11-08 10:17:47.000000000 +0100 | |
62 | +++ ocaml-3.11.0.CFLAGS/otherlibs/Makefile 2009-02-16 12:18:01.282552384 +0100 | |
63 | @@ -17,7 +17,7 @@ | |
04508f14 | 64 | |
31cbf6d8 JR |
65 | CAMLC=$(ROOTDIR)/ocamlcomp.sh |
66 | CAMLOPT=$(ROOTDIR)/ocamlcompopt.sh | |
67 | -CFLAGS=-I$(ROOTDIR)/byterun -O $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS) | |
68 | +override CFLAGS += -I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS) | |
04508f14 | 69 | |
31cbf6d8 JR |
70 | include ../Makefile.shared |
71 | # Note .. is the current directory (this makefile is included from | |
72 | diff -ur ocaml-3.11.0/otherlibs/Makefile.nt ocaml-3.11.0.CFLAGS/otherlibs/Makefile.nt | |
73 | --- ocaml-3.11.0/otherlibs/Makefile.nt 2007-11-08 10:17:48.000000000 +0100 | |
74 | +++ ocaml-3.11.0.CFLAGS/otherlibs/Makefile.nt 2009-02-16 12:18:01.282552384 +0100 | |
75 | @@ -17,7 +17,7 @@ | |
04508f14 | 76 | |
31cbf6d8 JR |
77 | CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib -w s |
78 | CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib -w s | |
79 | -CFLAGS=-I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS) | |
80 | +override CFLAGS += -I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS) | |
04508f14 | 81 | |
31cbf6d8 JR |
82 | include ../Makefile.shared |
83 | # Note .. is the current directory (this makefile is included from | |
84 | diff -ur ocaml-3.11.0/otherlibs/labltk/browser/Makefile.nt ocaml-3.11.0.CFLAGS/otherlibs/labltk/browser/Makefile.nt | |
85 | --- ocaml-3.11.0/otherlibs/labltk/browser/Makefile.nt 2008-12-03 14:03:18.000000000 +0100 | |
86 | +++ ocaml-3.11.0.CFLAGS/otherlibs/labltk/browser/Makefile.nt 2009-02-16 12:18:01.272552219 +0100 | |
87 | @@ -1,6 +1,6 @@ | |
04508f14 | 88 | OTHERSLIB=-I $(OTHERS)/win32unix -I $(OTHERS)/str -I $(OTHERS)/systhreads |
31cbf6d8 | 89 | |
04508f14 | 90 | -CCFLAGS=-I../../../byterun $(TK_DEFS) |
91 | +override CCFLAGS += -I../../../byterun $(TK_DEFS) $(CFLAGS) | |
92 | ||
31cbf6d8 JR |
93 | include ../support/Makefile.common |
94 | ||
95 | diff -ur ocaml-3.11.0/otherlibs/labltk/support/Makefile ocaml-3.11.0.CFLAGS/otherlibs/labltk/support/Makefile | |
96 | --- ocaml-3.11.0/otherlibs/labltk/support/Makefile 2008-04-22 09:38:07.000000000 +0200 | |
97 | +++ ocaml-3.11.0.CFLAGS/otherlibs/labltk/support/Makefile 2009-02-16 12:18:01.282552384 +0100 | |
98 | @@ -12,7 +12,7 @@ | |
99 | cltkFile.$(O) cltkMain.$(O) cltkMisc.$(O) cltkTimer.$(O) \ | |
100 | cltkVar.$(O) cltkWait.$(O) cltkImg.$(O) | |
04508f14 | 101 | |
102 | -CCFLAGS=-I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS) | |
103 | +override CCFLAGS += -I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS) $(CFLAGS) | |
104 | ||
31cbf6d8 JR |
105 | COMPFLAGS=-I $(OTHERS)/win32unix -I $(OTHERS)/unix |
106 | THFLAGS=-I $(OTHERS)/systhreads -I $(OTHERS)/threads | |
107 | diff -ur ocaml-3.11.0/otherlibs/labltk/tkanim/Makefile ocaml-3.11.0.CFLAGS/otherlibs/labltk/tkanim/Makefile | |
108 | --- ocaml-3.11.0/otherlibs/labltk/tkanim/Makefile 2007-12-12 15:09:45.000000000 +0100 | |
109 | +++ ocaml-3.11.0.CFLAGS/otherlibs/labltk/tkanim/Makefile 2009-02-16 12:18:01.282552384 +0100 | |
110 | @@ -4,7 +4,7 @@ | |
04508f14 | 111 | include ../support/Makefile.common |
112 | ||
31cbf6d8 | 113 | COMPFLAGS=-I ../support -I ../camltk -I ../../unix -I ../../win32unix |
04508f14 | 114 | -CCFLAGS=-I../../../byterun -I../support $(TK_DEFS) $(SHAREDCCCOMPOPTS) |
115 | +override CCFLAGS += -I../../../byterun -I../support $(TK_DEFS) $(SHAREDCCCOMPOPTS) $(CFLAGS) | |
116 | ||
31cbf6d8 JR |
117 | all: tkanim.cma libtkanim.$(A) |
118 | opt: tkanim.cmxa libtkanim.$(A) | |
119 | diff -ur ocaml-3.11.0/otherlibs/num/test/Makefile ocaml-3.11.0.CFLAGS/otherlibs/num/test/Makefile | |
120 | --- ocaml-3.11.0/otherlibs/num/test/Makefile 2008-09-10 18:02:52.000000000 +0200 | |
121 | +++ ocaml-3.11.0.CFLAGS/otherlibs/num/test/Makefile 2009-02-16 12:18:01.285892127 +0100 | |
04508f14 | 122 | @@ -18,7 +18,7 @@ |
31cbf6d8 | 123 | CAMLC=../../../boot/ocamlrun ../../../ocamlc -I ../../../stdlib -w A -warn-error A |
04508f14 | 124 | CAMLOPT=../../../boot/ocamlrun ../../../ocamlopt -I ../../../stdlib |
125 | CC=$(BYTECC) | |
47fc78cf JR |
126 | -CFLAGS=-I.. -I../../../byterun $(BYTECCCOMPOPTS) |
127 | +override CFLAGS += -I.. -I../../../byterun $(BYTECCCOMPOPTS) | |
04508f14 | 128 | |
31cbf6d8 JR |
129 | test: test.byt test.opt test_pi |
130 | if $(SUPPORTS_SHARED_LIBRARIES); \ | |
131 | diff -ur ocaml-3.11.0/otherlibs/num/test/Makefile.nt ocaml-3.11.0.CFLAGS/otherlibs/num/test/Makefile.nt | |
132 | --- ocaml-3.11.0/otherlibs/num/test/Makefile.nt 2004-04-01 15:10:12.000000000 +0200 | |
133 | +++ ocaml-3.11.0.CFLAGS/otherlibs/num/test/Makefile.nt 2009-02-16 12:18:01.285892127 +0100 | |
04508f14 | 134 | @@ -18,7 +18,7 @@ |
135 | CAMLC=../../../boot/ocamlrun ../../../ocamlc -I ../../../stdlib -I .. | |
136 | CAMLOPT=../../../boot/ocamlrun ../../../ocamlopt -I ../../../stdlib -I .. | |
137 | CC=$(BYTECC) | |
138 | -CFLAGS=-I.. $(BYTECCCOMPOPTS) | |
139 | +override CFLAGS += -I.. $(BYTECCCOMPOPTS) | |
140 | ||
141 | test: test.byt test.opt | |
142 | ../../../byterun/ocamlrun -I .. ./test.byt | |
31cbf6d8 JR |
143 | diff -ur ocaml-3.11.0/otherlibs/systhreads/Makefile ocaml-3.11.0.CFLAGS/otherlibs/systhreads/Makefile |
144 | --- ocaml-3.11.0/otherlibs/systhreads/Makefile 2008-07-15 17:31:32.000000000 +0200 | |
145 | +++ ocaml-3.11.0.CFLAGS/otherlibs/systhreads/Makefile 2009-02-16 12:18:13.469214951 +0100 | |
04508f14 | 146 | @@ -35,7 +35,7 @@ |
147 | $(MKLIB) -o threads $(BYTECODE_C_OBJS) | |
148 | ||
149 | posix_b.o: posix.c | |
150 | - $(BYTECC) -O -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \ | |
151 | + $(BYTECC) $(CFLAGS) -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \ | |
152 | -c posix.c | |
153 | mv posix.o posix_b.o | |
154 | ||
155 | @@ -45,7 +45,7 @@ | |
156 | $(AR) rc libthreadsnat.a $(NATIVECODE_C_OBJS) | |
157 | ||
158 | posix_n.o: posix.c | |
159 | - $(NATIVECC) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c posix.c | |
160 | + $(NATIVECC) $(CFLAGS) -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c posix.c | |
161 | mv posix.o posix_n.o | |
162 | ||
163 | threads.cma: $(THREAD_OBJS) | |
31cbf6d8 JR |
164 | diff -ur ocaml-3.11.0/otherlibs/systhreads/Makefile.nt ocaml-3.11.0.CFLAGS/otherlibs/systhreads/Makefile.nt |
165 | --- ocaml-3.11.0/otherlibs/systhreads/Makefile.nt 2007-11-06 16:16:56.000000000 +0100 | |
166 | +++ ocaml-3.11.0.CFLAGS/otherlibs/systhreads/Makefile.nt 2009-02-16 12:18:01.285892127 +0100 | |
167 | @@ -20,7 +20,7 @@ | |
168 | CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../win32unix | |
169 | COMPFLAGS=-warn-error A -g | |
170 | MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib | |
171 | -CFLAGS=-I../../byterun $(EXTRACFLAGS) | |
172 | +override CFLAGS += -I../../byterun $(EXTRACFLAGS) | |
173 | ||
174 | CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo | |
175 | CMIFILES=$(CAMLOBJS:.cmo=.cmi) | |
176 | diff -ur ocaml-3.11.0/otherlibs/threads/Makefile ocaml-3.11.0.CFLAGS/otherlibs/threads/Makefile | |
177 | --- ocaml-3.11.0/otherlibs/threads/Makefile 2008-10-08 15:07:13.000000000 +0200 | |
178 | +++ ocaml-3.11.0.CFLAGS/otherlibs/threads/Makefile 2009-02-16 12:18:01.285892127 +0100 | |
04508f14 | 179 | @@ -16,7 +16,7 @@ |
180 | include ../../config/Makefile | |
181 | ||
182 | CC=$(BYTECC) | |
183 | -CFLAGS=-I../../byterun -O $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g | |
184 | +override CFLAGS += -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g | |
185 | CAMLC=../../ocamlcomp.sh -I ../unix | |
186 | MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib | |
187 | COMPFLAGS=-warn-error A | |
31cbf6d8 JR |
188 | diff -ur ocaml-3.11.0/win32caml/Makefile ocaml-3.11.0.CFLAGS/win32caml/Makefile |
189 | --- ocaml-3.11.0/win32caml/Makefile 2007-11-15 14:21:15.000000000 +0100 | |
190 | +++ ocaml-3.11.0.CFLAGS/win32caml/Makefile 2009-02-16 12:18:01.289259949 +0100 | |
04508f14 | 191 | @@ -16,7 +16,7 @@ |
192 | include ../config/Makefile | |
193 | ||
194 | CC=$(BYTECC) | |
195 | -CFLAGS=$(BYTECCCOMPOPTS) | |
196 | +override CFLAGS += $(BYTECCCOMPOPTS) | |
197 | ||
198 | OBJS=startocaml.$(O) ocamlres.$(O) ocaml.$(O) menu.$(O) \ | |
199 | history.$(O) editbuffer.$(O) | |
31cbf6d8 JR |
200 | diff -ur ocaml-3.11.0/yacc/Makefile ocaml-3.11.0.CFLAGS/yacc/Makefile |
201 | --- ocaml-3.11.0/yacc/Makefile 2007-02-07 15:49:42.000000000 +0100 | |
202 | +++ ocaml-3.11.0.CFLAGS/yacc/Makefile 2009-02-16 12:18:01.289259949 +0100 | |
04508f14 | 203 | @@ -17,7 +17,7 @@ |
204 | include ../config/Makefile | |
205 | ||
206 | CC=$(BYTECC) | |
207 | -CFLAGS=-O -DNDEBUG $(BYTECCCOMPOPTS) | |
208 | +override CFLAGS += -DNDEBUG $(BYTECCCOMPOPTS) | |
209 | ||
210 | OBJS= closure.o error.o lalr.o lr0.o main.o mkpar.o output.o reader.o \ | |
211 | skeleton.o symtab.o verbose.o warshall.o |