# automating compiler build commands



## neilms (Nov 2, 2012)

Hi, I am using FreeBSD and g++ with emacs. I do not have access to any IDE as I am only using the console.
For simple toy programs in emacs I replace 'make -k' with something like 'g++ -o foo foo.cpp'. This is not a problem when the compile command involves only a few letters. 
But I am now a little more ambitious and using libcurl and curlpp to create a program. This involves telling the compiler where the relevant libcurl headers are:

```
-I/usr/local/include
```
The headers for curlpp are there too.
I must also specify linking options:

```
-L/usr/local/lib -lcurlpp
-L/usr/local/lib -lstdc++
-L/usr/local/lib -lcurl -rpath=/usr/lib: /usr/local/lib -lssl -lcrypto -la
```

Please can you help me so I do not have to type all these options each time I visit my project. Is there a simple way to automate  this?

Many thanks for your help.


----------



## J65nko (Nov 2, 2012)

You can automate this with a Makefile. See PMake â€” A Tutorial


----------



## kpa (Nov 2, 2012)

Also take a look at devel/pkgconf.


----------



## neilms (Nov 4, 2012)

Thank you for replying. I did use a makefile.


----------

