Linux Debian support - Writing a Makefile

This is Interesting: Free IT Magazines  
Home > Archive > Linux Debian support > June 2007 > Writing a Makefile





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Writing a Makefile
jamiil

2007-06-17, 1:14 pm

Where does the $(LIB) should be plugged in in the Makefile below. I am
getting an error that reads:
------------------
exception.hpp linker input file unused because linking not done
------------------
Thanks in advance folks.

# My Makefile



# Compiler name

CPP=g++

# Flagas

CFLAGS = -Wall -g -ansi `gtk-config --cflags`
LIBS = `gtk-config --libs`#-- What do I do with this var? -#



# Files to be included
EXCEPTION_HPP=./exception/exception.hpp
EXCEPTION_CPP=./exception/exception.cpp

# Variables

OBJS = main.o exception.o

EXEC = MyApp



#Application name

my_app: $(OBJS)

$(CPP) $(LDLIBS) $(OBJS) -o $(EXEC)

main.o: main.cpp

$(CPP) $(CFLAGS) -c main.cpp

exception.o: $(EXCEPTION_HPP)

$(CPP) $(CFLAGS) -c $(EXCEPTION_CPP)




clean:

rm -f exception.o

rm -f $(EXEC)



PHONY: clean

Don Piven

2007-06-20, 7:14 am

Sez jamiil:
> Where does the $(LIB) should be plugged in in the Makefile below. I am
> getting an error that reads:
> ------------------
> exception.hpp linker input file unused because linking not done
> ------------------
> Thanks in advance folks.
>
> # My Makefile
>
> [much snippage]
>
> CFLAGS = -Wall -g -ansi `gtk-config --cflags`
> LIBS = `gtk-config --libs`#-- What do I do with this var? -#
> OBJS = main.o exception.o
>
> my_app: $(OBJS)
>
> $(CPP) $(LDLIBS) $(OBJS) -o $(EXEC)


You might want to choose between LIBS and LDLIBS :-)
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com