problems with Makefile



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)

.



Relevant Pages

  • Re: problems with Makefile
    ... Dr. Locke Z2A wrote: ... 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 ...
    (comp.programming)
  • Re: Windows VS 6.0 Projet nach Linux konvertieren.
    ... Habe win Visual Studio 6.0 Projekt unter windows gemeint. ... Nach Linux: ein Tool, das mir ein makefile oder eine configure erzeugt. ... Werd mir aber KDevelop auch noch ansehen. ...
    (de.comp.os.unix.programming)
  • Re: Makefile rules for output/object dir
    ... How can I ensure inside the makefile the creation of the OBJ_DIR which ... works on Windows and linux? ...
    (comp.programming)
  • Help: makefile in Windows
    ... I am learning Extending Python, by testing the demo script of ... In the book, a makefile for Linux is there, but I ... am using Windows currently. ...
    (comp.lang.python)
  • NASM tutorial
    ... Hello World for Linux and Windows along with the appropriate makefile. ... some tutorials for Windows but the problem with this is that ...
    (alt.lang.asm)