problems with Makefile
- From: "Dr. Locke Z2A" <DocZ2A@xxxxxxxxx>
- Date: 3 Jun 2006 19:19:46 -0700
First off, I am a complete noob to making makefiles. I was writing a
program for Windows using Dev-C++ (which generates makefiles for me)
and the Allegro library and I decided to start using Linux to write it
(so I have to write my own makefile). The code can be compiled on
Linux but there is one problem: I can't get the makefile to work right.
I tried to take the Windows makefile and make the Linux one based on
that, but it hasn't worked so far. When I run "make" I get a ton of
errors about the Allegro functions being undefined references. This
leads me to believe that I have not said where Allegro is correctly.
Can anyone help me with this? Here is the makefile:
CC = gcc
RES =
OBJ = main.o mappyal.o bullet.o setup.o misc.o enemy.o $(RES)
LINKOBJ = main.o mappyal.o bullet.o setup.o misc.o enemy.o $(RES)
LIBS = -L"/usr/lib/"
INCS = -I"/usr/include/"
BIN = wheee
CFLAGS = $(INCS) -DALLEGRO_STATICLINK
RM = rm -f
..PHONY: all all-before all-after clean clean-custom
all: all-before wheee all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o "wheee" $(LIBS)
main.o: main.c
$(CC) -c main.c -o main.o $(CFLAGS)
mappyal.o: mappyal.c
$(CC) -c mappyal.c -o mappyal.o $(CFLAGS)
bullet.o: bullet.c
$(CC) -c bullet.c -o bullet.o $(CFLAGS)
setup.o: setup.c
$(CC) -c setup.c -o setup.o $(CFLAGS)
misc.o: misc.c
$(CC) -c misc.c -o misc.o $(CFLAGS)
enemy.o: enemy.c
$(CC) -c enemy.c -o enemy.o $(CFLAGS)
.
- Follow-Ups:
- Re: problems with Makefile
- From: Irrational Number
- Re: problems with Makefile
- From: Richard Heathfield
- Re: problems with Makefile
- Prev by Date: Re: Is my CS instructor nuts?
- Next by Date: Re: problems with Makefile
- Previous by thread: game design
- Next by thread: Re: problems with Makefile
- Index(es):
Relevant Pages
|