aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-21 16:12:18 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-21 16:12:18 +0000
commit2e74a14de5ca180a700a731732700f9a32891ba5 (patch)
tree5f0c7162ed8575d3a94bfdef138978b49213f332
parent6fb7dd4ec420339578a69537387170a7c2fb288b (diff)
Win32: let's directly make coqtop.exe and coqide.exe incorporate coq.ico
This is an adaptation of commit 13747 for 8.3 branch git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14038 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--ide/coq_icon.rc1
-rw-r--r--myocamlbuild.ml20
2 files changed, 19 insertions, 2 deletions
diff --git a/ide/coq_icon.rc b/ide/coq_icon.rc
new file mode 100644
index 000000000..f873e7de1
--- /dev/null
+++ b/ide/coq_icon.rc
@@ -0,0 +1 @@
+large ICON ide/coq.ico
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index acaac12e1..05d99dbd2 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -64,8 +64,10 @@ let w32pref = "i586-mingw32msvc"
let w32ocamlc = w32pref^"-ocamlc"
let w32ocamlopt = w32pref^"-ocamlopt"
let w32ocamlmklib = w32pref^"-ocamlmklib"
+let w32res = w32pref^"-windres"
let w32lib = "/usr/"^w32pref^"/lib/"
let w32bin = "/usr/"^w32pref^"/bin/"
+let w32ico = "ide/coq_icon.o"
let _ = if w32 then begin
Options.ocamlopt := A w32ocamlopt;
@@ -381,14 +383,28 @@ let extra_rules () = begin
"let core_objs = \"Coq_config "^core_mods^"\"\n"],
tolink));
+(** For windows, building coff object file from a .rc (for the icon) *)
+
+ if w32 then rule ".rc.o" ~deps:["%.rc";"ide/coq.ico"] ~prod:"%.o"
+ (fun env _ ->
+ let rc = env "%.rc" and o = env "%.o" in
+ Cmd (S [P w32res;A "--input-format";A "rc";A "--input";P rc;
+ A "--output-format";A "coff";A "--output"; Px o]));
+
+(** For windows, Coqide should incorporate the Coq icon *)
+
+ if w32 then flag ["link"; "ocaml"; "program"; "ide"] (P w32ico);
+
(** Coqtop *)
let () =
let fo = coqtop^".native" and fb = coqtop^".byte" in
- let depsall = [coqmktop_boot;libcoqrun] in
+ let depsall = (if w32 then [w32ico] else [])@[coqmktop_boot;libcoqrun] in
let depso = "coq_config.cmx" :: core_cmxa in
let depsb = "coq_config.cmo" :: core_cma in
- let w32flag = if not w32 then N else S ([A"-camlbin";A w32bin]) in
+ let w32flag =
+ if not w32 then N else S ([A"-camlbin";A w32bin;A "-ccopt";P w32ico])
+ in
if opt then rule fo ~prod:fo ~deps:(depsall@depso) ~insert:`top
(cmd [P coqmktop_boot;w32flag;A"-boot";A"-opt";incl fo;A"-o";Px fo]);
rule fb ~prod:fb ~deps:(depsall@depsb) ~insert:`top