[LLVMdev] llvmc for PIC16

Sanjiv Gupta sanjiv.gupta at microchip.com
Mon Jun 15 07:11:47 PDT 2009


Mikhail Glushenkov wrote:
> Hi Sanjiv,
>
> 2009/6/15 Sanjiv Gupta <sanjiv.gupta at microchip.com>:
>   
>> Hi Mikhail,
>> How do you build mcc16 executable?
>>     
>
> This should work:
>
> $ cd $LLVM_DIR/tools/llvmc/examples/mcc16
> $ make
>
>   
I configure llvm into a separate directory from source.
When I do the steps you mentioned in the source directory, this is what 
I get.

[i00171 at rhino mcc16]$ make
../../../../Makefile.common:61: ../../../../Makefile.config: No such 
file or directory
../../../../Makefile.common:69: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'.  Stop.

Ditto for the "Simple" plugin.

[i00171 at rhino mcc16]$ cd ../Simple/


../../../../Makefile.common:61: ../../../../Makefile.config: No such 
file or directory
../../../../Makefile.common:69: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'.  Stop.
[i00171 at rhino Simple]$


I copied the "Simple" plugin to the configured directory

$ cd objs/tools/llvmc/plugins
$ cp -rf $LLVM_SRC/tools/llvmc/example/Simple MyPlugin

Changed the plugin name in the Makefile from "Simple" to "MyPlugin", and 
moved "Simple.td" to "MyPlugin.td"

$ make LLVMC_BUILTIN_PLUGINS=MyPlugin LLVMC_BASED_DRIVER_NAME=mydriver

That created "mydriver" executable for me.

- Sanjiv
> If you're building from some other dir, you'll need to update
> mcc16/Makefile, so it knows where Makefile.common is located.
>
>   
>> There are so many confusing things there: driver, plugins, example, Skelton
>> etc.
>> The LLVMC-Tutorial doesn't clearly talk about them.
>>     
>
> Yes, I know, the documentation doesn't talk about creating standalone
> drivers. Sorry for that, I was planning to update it for ages...
> For now, please look at examples/Skeleton, which is a standalone
> driver skeleton, on which the mcc16 driver is based.
>
>   
>> I think the correct command line is
>> $ make LLVMC_BUILTIN_PLUGINS=MyPlugin LLVMC_BASED_DRIVER_NAME=mydriver
>>
>> rather than
>> $ make BUILTIN_PLUGINS=MyPlugin DRIVER_NAME=mydriver
>> (I found the later one in LLVMC-Reference)
>>     
>
> This section is about building the "main" llvmc driver and its plugins.
> Creation of standalone drivers is not described in the docs yet (it
> was added relatively recently).
>
>   




More information about the llvm-dev mailing list