2010-03-30 12 views
19

मैं वर्तमान मेंकई Erlang बीम फ़ाइलों का निर्माण?

c(module_name) 

उपयोग कर रहा हूँ मेरी Erlang फ़ाइलों एक के बाद एक का निर्माण। Erlang के लिए निर्माण प्रक्रिया कैसे हो सकती है जब उनके पास एकाधिक फ़ाइलें हों?

उत्तर

24

मैं Erlang make का उपयोग करके शुरू करता हूं, क्योंकि यह एक बार वीएम शुरू करता है और पुन: संकलित करने की आवश्यकता वाली सभी चीजों को संकलित करता है।

प्रयास करें अपने स्रोत निर्देशिका में निम्नलिखित है, यह है कि एक इसी बीम फ़ाइल याद कर रहे हैं उन .erl फाइल या संकलन होगा उन जहां .erl फ़ाइल के बाद से बीम फ़ाइल संकलित किया गया था संशोधित किया गया है:

erl -make 

{'*', 
    [{outdir,"../ebin"}, 
    debug_info]}. 
5

परियोजनाओं का एक बहुत एक नियमित रूप से पुराने मेकअप फ़ाइल और erlc

०१२३५१६४१० का उपयोग करें: इस तरह के Ebin में .beam फ़ाइलों debug_info के साथ सभी स्रोत फ़ाइलें संकलन और रखने के रूप में अतिरिक्त चाल, के लिए Emakefile के बारे में जानें
erlc -h 
Usage: erlc [options] file.ext ... 
Options: 
-b type  type of output file (e.g. jam or beam) 
-d    turn on debugging of erlc itself 
-Dname   define name 
-Dname=value define name to have value 
-hybrid  compile using hybrid-heap emulator 
-help   shows this help text 
-I path  where to search for include files 
-o name  name output directory or file 
-pa path  add path to the front of Erlang's code path 
-pz path  add path to the end of Erlang's code path 
-smp   compile using SMP emulator 
-v    verbose compiler output 
-Werror  make all warnings into errors 
-W0   disable warnings 
-Wnumber  set warning level to number 
-Wall   enable all warnings 
-W    enable warnings (default; same as -W1) 
-E    generate listing of expanded code (Erlang compiler) 
-S    generate assembly listing (Erlang compiler) 
-P    generate listing of preprocessed code (Erlang compiler) 
+term   pass the Erlang term unchanged to the compiler 
1

Erlang Make and Emakefiles शायद शुरू करने का एक अच्छा तरीका है।

उदाहरण के तौर पर, आप Erlang Web की बिल्ड सिस्टम को देखना चाहते हैं।

विशिष्ट में, आप उनके Emakefile और उनके compile.erl पर देख सकते हैं।

11

इस निर्देशिका में सब कुछ आप अभी हैं संकलित:

cover:compile_directory(). 
2

आप rebar 'का उपयोग कर सकते हैं, एक Erlang बाशो से उपकरण है जो OTP अनुरूप है निर्माण: इस एक में एकाधिक erlang अनुप्रयोगों सेट लगातार निर्देशिका संरचना और आपको फ़ाइलों को सिर्फ .beams में संकलित करने से अधिक करने की अनुमति देता है। [Rebar संकलन]

उदाहरण के लिए, आप कर सकते हैं
* चलाने परीक्षण (eUnit + सुविधा/प्रतिगमन) [rebar परीक्षण]

- build releases [rebar rel] 
- start ci-builds 
- specify dependencies from multiple sources in its config file 
- enable SNMPwalks through data collected by SNMP agents of various types 
- (in conjunction with xref and grapherl) generate call graphs of entire applications 
- (in conjunction with fprof and fprof_graph) generate profiling diagrams 
- run dialyzer to do static code analysis 

सभी rebar आदेश, 'rebar -c' को देखने के लिए होगा आपको एक पूरी तस्वीर दे

rebar वेरिएंट, चारों ओर चल :-)

आप rebar प्राप्त कर सकते हैं here

wiki यह सब कहते हैं के साथ बाशो से है।

संबंधित मुद्दे