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
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
14 FLAGS=-I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE \
15 -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(IFLEXDIR)
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)
22 COBJS=startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o \
23 misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \
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
28 include ../config/Makefile
31 -CFLAGS=-I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(NATIVECCCOMPOPTS)
32 +override CFLAGS += -I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(NATIVECCCOMPOPTS)
34 COBJS=startup.$(O) main.$(O) fail.$(O) roots.$(O) signals.$(O) signals_asm.$(O) \
35 misc.$(O) freelist.$(O) major_gc.$(O) minor_gc.$(O) memory.$(O) alloc.$(O) \
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
41 include Makefile.common
43 -CFLAGS=-DCAML_NAME_SPACE -O $(BYTECCCOMPOPTS) $(IFLEXDIR)
44 +override CFLAGS += -DCAML_NAME_SPACE $(BYTECCCOMPOPTS) $(IFLEXDIR)
45 DFLAGS=-DCAML_NAME_SPACE -g -DDEBUG $(BYTECCCOMPOPTS)
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
53 include Makefile.common
55 -CFLAGS=-DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR)
56 +override CFLAGS += -DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR)
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
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)
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
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)
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
88 OTHERSLIB=-I $(OTHERS)/win32unix -I $(OTHERS)/str -I $(OTHERS)/systhreads
90 -CCFLAGS=-I../../../byterun $(TK_DEFS)
91 +override CCFLAGS += -I../../../byterun $(TK_DEFS) $(CFLAGS)
93 include ../support/Makefile.common
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
99 cltkFile.$(O) cltkMain.$(O) cltkMisc.$(O) cltkTimer.$(O) \
100 cltkVar.$(O) cltkWait.$(O) cltkImg.$(O)
102 -CCFLAGS=-I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS)
103 +override CCFLAGS += -I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS) $(CFLAGS)
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
111 include ../support/Makefile.common
113 COMPFLAGS=-I ../support -I ../camltk -I ../../unix -I ../../win32unix
114 -CCFLAGS=-I../../../byterun -I../support $(TK_DEFS) $(SHAREDCCCOMPOPTS)
115 +override CCFLAGS += -I../../../byterun -I../support $(TK_DEFS) $(SHAREDCCCOMPOPTS) $(CFLAGS)
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
123 CAMLC=../../../boot/ocamlrun ../../../ocamlc -I ../../../stdlib -w A -warn-error A
124 CAMLOPT=../../../boot/ocamlrun ../../../ocamlopt -I ../../../stdlib
126 -CFLAGS=-I.. -I../../../byterun $(BYTECCCOMPOPTS)
127 +override CFLAGS += -I.. -I../../../byterun $(BYTECCCOMPOPTS)
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
135 CAMLC=../../../boot/ocamlrun ../../../ocamlc -I ../../../stdlib -I ..
136 CAMLOPT=../../../boot/ocamlrun ../../../ocamlopt -I ../../../stdlib -I ..
138 -CFLAGS=-I.. $(BYTECCCOMPOPTS)
139 +override CFLAGS += -I.. $(BYTECCCOMPOPTS)
141 test: test.byt test.opt
142 ../../../byterun/ocamlrun -I .. ./test.byt
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
147 $(MKLIB) -o threads $(BYTECODE_C_OBJS)
150 - $(BYTECC) -O -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
151 + $(BYTECC) $(CFLAGS) -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
156 $(AR) rc libthreadsnat.a $(NATIVECODE_C_OBJS)
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
163 threads.cma: $(THREAD_OBJS)
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
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)
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
180 include ../../config/Makefile
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
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
192 include ../config/Makefile
195 -CFLAGS=$(BYTECCCOMPOPTS)
196 +override CFLAGS += $(BYTECCCOMPOPTS)
198 OBJS=startocaml.$(O) ocamlres.$(O) ocaml.$(O) menu.$(O) \
199 history.$(O) editbuffer.$(O)
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
204 include ../config/Makefile
207 -CFLAGS=-O -DNDEBUG $(BYTECCCOMPOPTS)
208 +override CFLAGS += -DNDEBUG $(BYTECCCOMPOPTS)
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