2013-12-12 2 views
0

수를가 생성 된 파일을 사용 :어떻게 생성하고 다음 작업을 수행하는, OCP-빌드,

  1. 이 발전기를 컴파일합니다.
  2. 생성기를 호출하여 파일을 생성합니다.
  3. 생성 된 파일로 프로젝트를 컴파일하십시오.

    (generator.ocp)

    begin library "error_gen" 
        sort = true 
        files = [ "error_gen.ml" ] 
        requires = [str] 
    end 
    

    (generated.ocp)

    begin library "error_code" 
        sort = true 
        files = [ 
         "error_code.ml" (
         pp = [ "./_obuild/error_gen/error_gen.byte" ] 
         pp_requires = [ "error_gen:byte" ] 
        ) 
        ] 
        requires = ["error_gen"] 
    end 
    

    (그리고 main.ocp)

    :

지금까지, 나는이 시도

begin program "main" 
    sort = true 
    files = [] 
    requires = ["error_code" "parser"] 
end 

은이 메시지와 함께 불평 :

Error: in project "error_code", the source filename "src/generated/error_code.ml" does not exist

가 좀 지원은 어떤이 크게 감사합니다 도움 라인 (46)

"indentVersion.ml" (ocp2ml) (* auto-generated by ocp-build *) 

ocp-indent

프로젝트로, 버전 파일 생성을 위해 존재하는 것을보고, 감사.

begin library "error_code" 
    sort = true 
    files = [ "error_code.ml" ] 
    build_rules = [ 
     "error_code.ml" (
     (* the files that are needed to call the command *) 
     sources = [ "%{error_gen_FULL_DST_DIR}%/error_gen.byte" ] 
     (* the commands to be executed, in the sub-directory of the library 
      each command has the syntax: { "COMMAND" "ARG1" "ARG2" ... } 
     *) 
     commands = [ 
      { "%{error_gen_FULL_DST_DIR}%/error_gen.byte" } 
     ] 
    ) 
    ] 
    requires = ["error_gen"] 
end 

이, 예를 들어, 사용된다 : github.com/OCamlPro/ocp-build, 당신은 문제를 해결할 수있는 OCP-빌드 버전을 찾을 지점에서

+0

나는 생각하지 않는다 이 순간에 가능하다는 것. 이미 지원된다면 나는 아주 놀라게 될 것입니다. 내 생각에,이 프로젝트에 대해 물어볼 좋은 곳은 github의 버그 추적기입니다. – Kakadu

답변

1

"다음" wxOCaml :

명령은 옵션과 함께 포스트 고정 할 수 있습니다

https://github.com/OCamlPro/ocplib-wxOCaml/blob/next-ocpbuild/configure.ocp

:

{ "configure" } (chdir = "subdirectory") (* to execute in a sub-directory *) 
{ "cat" "toto" } (stdout = "new_toto") (* to copy the stdout in "new_toto" *) 
+0

그런 기능을 사용할 수 있다는 것을 알면 좋습니다. 그러나이 버전을 사용할 수 없으므로 Makefile ocp-build의 맨 위에. –

관련 문제