LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2002, 04:52 PM   #1
bkxsammy
Member
 
Registered: Oct 2002
Posts: 30

Rep: Reputation: 15
makemake?


Alright...im kinda wonderin how could i make a makefile in Linux Redhat 7.3. When im on Solaris 8 there is jus a command makemake > Makefile but i dont see linux having that. How would i compile my code ??

Thanks guys
 
Old 11-08-2002, 05:25 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
basic makefiles are a doddle.... but there's a better way to sort it out if you plan to write gpl code or something in that vein, automake and autoconf:

http://sources.redhat.com/autobook/a...obook_toc.html

i did this for a project i'm working on called acidrip and to make a whole distributable setup for a c program, i had to create two files, a configure.in:
Code:
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lsdvd.c)
AM_INIT_AUTOMAKE(lsdvd, 0.3)
CFLAGS=-g
AC_PROG_CC
AC_CHECK_LIB(dvdread, DVDOpen, , AC_MSG_ERROR([libdvdread not found!]))
AC_MSG_CHECKING([for dvdread/ifo_read.h])
AC_TRY_COMPILE([#include <dvdread/ifo_read.h>], ,
        AC_MSG_RESULT([yes]), 
        AC_MSG_RESULT([no]) 
        AC_MSG_ERROR([Header files for dvdread not found]))
AC_OUTPUT(Makefile)
and a Makefile.am
Code:
bin_PROGRAMS = lsdvd
lsdvd_SOURCES = lsdvd.c
From this, you just need to run autoconf and automake and it will generate a full configure script and makefile and everything, you can then easily add on compatability checks, like i have in my configure.in program (the ac_try_compile block) that link i've given is what i used to get started, and it's really really easy once you suss out which way up is.
 
Old 11-09-2002, 03:43 AM   #3
bkxsammy
Member
 
Registered: Oct 2002
Posts: 30

Original Poster
Rep: Reputation: 15
how do u know what to write for the configure.in file?
 
Old 11-09-2002, 12:42 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you look it up in the online book, that's the reason i put that link there.... just search google, there's loads of examples if you look...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration