BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 7th, 2004, 07:04 AM
kepler kepler is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 281 kepler User rank is Sergeant (500 - 2000 Reputation Level)kepler User rank is Sergeant (500 - 2000 Reputation Level)kepler User rank is Sergeant (500 - 2000 Reputation Level)kepler User rank is Sergeant (500 - 2000 Reputation Level)kepler User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 4 h 56 m 19 sec
Reputation Power: 10
Makefile in BSD

Hi,

I'm trying for some time to compile some C files to run in the Linux environment. Until now, the only thing I've got is a semi-operational executable ( works only 60% ). Following the advice of a friend, I manage to get a shell account in a BSD server. So I putted all the files there, including the makefile.unx
I run the make command and get something stupid like:

-f sephem.cnsi - pedantic...etc

and stopped automaticaly.

The makefile is like this:

Quote:

INCLUDE=
LIBS= -lm
CC=gcc

# For normal use
# CFLAGS=-ansi -pedantic -Wall -s -O
# For debugging
CFLAGS = -ansi -pedantic -Wall -g

TARGETS = sephem look

# Now the actual rules

all: $(TARGETS)

clean:
-rm *.o
-rm *.log
-rm *.exe


sephem: sephem.o astrolib.o astrocon.o support.o
$(CC) $(CFLAGS) -o sephem sephem.o astrolib.o astrocon.o support.o $(LIBS)

look: look.o
$(CC) $(CFLAGS) -o look look.o $(LIBS)

sephem.o: sephem.c astrolib.h support.h
$(CC) $(CFLAGS) -c sephem.c

look.o: look.c
$(CC) $(CFLAGS) -c look.c

astrolib.o: astrolib.c astrolib.h astrocon.h support.h
$(CC) $(CFLAGS) -c astrolib.c

astrocon.o: astrocon.c astrocon.h
$(CC) $(CFLAGS) -c astrocon.c

support.o: support.c support.h
$(CC) $(CFLAGS) -c support.c


What must I change in this makefile to be compatible with BSD? And one more question: will the result exes (2) run in any Linux environment?

Best regards,

Kepler

Reply With Quote
  #2  
Old November 8th, 2004, 07:40 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There are thousands of examples of Makefile if you have the FreeBSD source in your /usr/src. If not, just go to the FTP site and get it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Makefile in BSD


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway