LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Create configure script, makefile etc. (https://www.linuxquestions.org/questions/programming-9/create-configure-script-makefile-etc-467933/)

introuble 07-26-2006 01:35 PM

Create configure script, makefile etc.
 
Ok .. so I've created my program which is "scattered" in various source files in various directories. Language: C. Let's assume I've been building it by compiling every single source file with:

Code:

gcc -O2 -c file.c -o file.o
and then linking all the objects together in a final executable. How do I go from that to a simple:

Code:

./configure && make && make install
?

raskin 07-26-2006 01:55 PM

Do you really want configure? read info make - for your purpose it's enough..

crazyjimbo 07-26-2006 02:19 PM

If it is just a simple package, you can probably hand write a makefile. The GNU Manual should explain things well enough: http://www.gnu.org/software/make/manual/make.html

However, to get the
Code:

./configure && make && makeinstall
format, you'd be best using a suite of tools called GNU Autotools, which include autoconf and automake to generate the configure script and makefile. A tutorial I found useful for these is here: http://www.seul.org/docs/autotut/

Good Luck!


All times are GMT -5. The time now is 04:13 PM.