# This -*- makefile -*- is part of our reusable OCaml BRICKS library # Copyright (C) 2008 Luca Saiu # Copyright (C) 2008 Jean-Vincent Loddo # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . COMPILE_OPTIONS += -thread DIRECTORIES_TO_INCLUDE = threads lablgtk2 LIBRARIES_TO_LINK = str unix threads lablgtk NATIVE_PROGRAMS = BYTE_PROGRAMS = NATIVE_LIBRARIES = ocamlbricks.cmxa BYTE_LIBRARIES = ocamlbricks.cma PP_OPTION = camlp4of GETTEXT=GETTEXT C_OBJECTS_TO_LINK = gettext-c-wrapper does-process-exist-c-wrapper OTHER_LIBRARY_FILES_TO_INSTALL = _build/{gettext-c-wrapper.o,does-process-exist-c-wrapper.o,gettext_extract_pot_p4.cmo} _build/gettext-c-wrapper.o: $(GETTEXT)/gettext-c-wrapper.c @$(call READ_CONFIG, ocaml_sources); \ (mkdir _build &> /dev/null || true) && \ gcc -g -O3 -I $$ocaml_sources -o $@ -c $^ _build/does-process-exist-c-wrapper.o: EXTRA/does-process-exist-c-wrapper.c @$(call READ_CONFIG, ocaml_sources); \ (mkdir _build &> /dev/null || true) && \ gcc -g -O3 -I $$ocaml_sources -o $@ -c $^ _build/gettext_extract_pot_p4.cmo: $(GETTEXT)/gettext_extract_pot_p4.ml ocamlc -c -I +camlp4 -pp camlp4of camlp4lib.cma -o $@ $< # idempotent rebuilding: @chmod +x Makefile.d/ocamlmklib_wrapper.sh @Makefile.d/ocamlmklib_wrapper.sh $(C_OBJECTS_TO_LINK) preprocessors: _build/gettext_extract_pot_p4.cmo install-libraries-local: rebuilding preprocessors # Remove the automatically-generated documentation on clean: clean-local: @(rm -rf doc/html) rm -rf _build/does_process_exist.o # Test without installation LIBRARY_TO_TEST=_build/ocamlbricks.cma test: rebuilding @test -f $(LIBRARY_TO_TEST) || make @chmod +x Makefile.d/test.sh @Makefile.d/test.sh -l "$(LIBRARIES_TO_LINK)" -i "$(DIRECTORIES_TO_INCLUDE)"