LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-12-2005, 05:26 AM   #1
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
Makefile differnce between FreeBSD and Linux


Hi, I am developing a simple compiler as an assignment in school. And this is the first time I try to use Makefile to handle the compilation process. I use FreeBSD in school and Debian at home. I have a Makefile which starts like this:

Code:
# For FreeBSD
#.if defined(TESTING)
#CFLAGS += -DTESTING
#.endif

#.if defined(PRINT_TREE)
#CFLAGS += -DPRINT_TREE
#.endif

#.if defined(DEBUG)
#CFLAGS += -g
#.endif

# For Linux
ifdef TESTING
CFLAGS += -DTESTING
endif

ifdef PRINT_TREE
CFLAGS += -DPRINT_TREE
endif

ifdef DEBUG
CFLAGS += -g
endif
As you can see, the codes I use to set the compilation options are different on FreeBSD and on Linux. I would like to ask whether there is a way to do this properly that work in both OSes?

Thanks.
 
Old 01-12-2005, 05:38 AM   #2
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
If you are using gnu make on FreeBSD, as you are on debian, then this difference should not occur.

Which make are you using on FreeBSD?

Code:
$ make -v
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
 
Old 01-13-2005, 08:09 AM   #3
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Original Poster
Rep: Reputation: 31
I think it is not GNU make since there is another command which is gmake which showed the above version information.

Why is the Make that comes with FreeBSD so much different with GNU Make???
 
Old 01-13-2005, 02:47 PM   #4
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
In that case, I suggest you use gmake on FreeBSD to build your code.

Groetjes,

Kees-Jan
 
Old 01-17-2005, 10:05 PM   #5
jeorj_euler
LQ Newbie
 
Registered: Jan 2005
Location: MidWest United States
Distribution: Mandrake, Knoppix
Posts: 9

Rep: Reputation: 0
Quote:
Originally posted by koyi

Why is the Make that comes with FreeBSD so much different with GNU Make???
Hard to say, but Berkeley make is designed for sources written "for" operating systems of the BSD family. The question is whether a Berkeley version of a common UNIX utility, such as dd, can be compiled on Linux. One of these days, I will endeauvor to compare the sources.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
noapic or nolapic any differnce? shanenin Linux - Software 2 04-01-2005 03:53 AM
Whats the differnce between gentoo linux and lfs ravikumarG Linux From Scratch 3 03-16-2005 12:30 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM
what is the differnce between RAW Vs. BLOCK ? juanb Linux - General 0 12-10-2002 01:40 PM

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

All times are GMT -5. The time now is 11:07 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