hi guys im trying to write a makefile which contains :two cpp files and two header files.
now i've put cppfiles in a folder called source whose path is: /root/workspace/source
and header files in a folder called header whose path is:
/root/workspace/makedemo/header
my makefile is in the path:/root/workspace/makedemo
my makefile was like this:
HEADERS = $(shell /root/workspace/makedemo/header ls *.h)
SOURCES = $(shell /root/workspace/source ls *.cpp)
COMPILERFLAGS = -W -Wall
DEBUGFLAGS = -g
CPPCOMPILER = g++
INCLUDES = -I.
OBJS = $(SOURCES:.cpp=.o)
BINARY = output
all: $(BINARY)
$(BINARY): $(OBJS)
$(CPPCOMPILER) $(COMPILERFLAGS) $(INCLUDES) -o $(BINARY) $(OBJS)
depend:
makedepend -f- -- $(SOURCES) > .depend_file
clean:
rm -rf *.o .depend_file $(BINARY) *~
#DO NOT DELETE
im sure that i've given the correct path but it is showing errors like this:
[root@localhost makedemo]# make
/bin/sh: /root/workspace/source: is a directory
/bin/sh: /root/workspace/source: is a directory
g++ -W -Wall -I. -o output
g++: no input files
make: *** [output] Error 1
any help appreciated...