[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Please help with makefile
From: |
Stephen Mayes |
Subject: |
Please help with makefile |
Date: |
Fri, 11 Feb 2005 19:03:49 -0500 |
Please someone tell me why this Makefile doesn't work, or give me an example
of what I need.
This is making me nuts.
My trouble is that I cannot create the object files in the source directory.
BIN=/usr/bin/
CC=$(BIN)gcc
SRCDIR=src/
INCDIR=inc/
OBJDIR=obj/
CFLAGS=-Wall -ansi -pedantic -g -c -O2 -I$(INCDIR)
LINK=$(BIN)gcc
LFLAGS=
LIBS=
OUT=btnet
OBJS=\
$(OBJDIR)main.o\
$(OBJDIR)connection.o\
$(OBJDIR)llist.o
all: $(OUT)
@echo Done
$(OBJDIR)%.o : $(SRCDIR)%.c
@echo Compiling $<...
$(CC) $(CFLAGS) $< -o $@
@echo -------------------
$(OUT) : $(OBJS) Makefile
@echo Linking $(OUT)...
@$(LINK) -o $(OUT) $(LFLAGS) $(OBJS) $(LIBS)
@strip -s $(OUT)
@echo -------------------
$(OBJDIR)connection.o:\
$(INCDIR)main.h\
$(INCDIR)connection.h\
$(OBJDIR)llist.o:\
$(INCDIR)llist.h\
$(OBJDIR)main.o:\
$(INCDIR)main.h\
$(INCDIR)connection.h\
$(INCDIR)llist.h\
clean:
@rm obj/* > /dev/null
@rm btnet > /dev/null
- Please help with makefile,
Stephen Mayes <=