
November 7th, 2004, 07:04 AM
|
|
|
|
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
|