473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Make utility in Unix. Make over different directories

21
Hi,

I have no idea if this is the right section to post this in. But i thought it maybe belonged here most.

The problem i having is actually, most likely really simple. But here i am running for help. I have read a lot about make files, but well, not a single one actually sais something about the approach i'm using.

Which ofcourse might perfectly mean i'm doing something completely wrong. :P.

Well, I'll cut the case.

I've divided my source over 4 different directories.
there are the:
-api
-test
-plugins
-main

directories. The main.cpp file is in the main directorie.
In the 'src' directory. Where all these subdirectories are in, is the makefile i'm using.

The main.cpp file needs to be linked with .o files from, well all the different maps. But i hope that isn't a problem.

Expand|Select|Wrap|Line Numbers
  1. SOURCES := /main/main.cpp \
  2.     /api/product.cpp \
  3.     /api/basicObject.cpp \
  4.     /api/productList.cpp \
  5.     /api/ingredient.cpp \
  6.     /api/ingredientList.cpp \
  7.     /api/controlUnit.cpp \
  8.     /tests/productTest.cpp \
  9.     /tests/productListTest.cpp \
  10.     /tests/ingredientTest.cpp \
  11.     /tests/ingredientListTest.cpp \
  12.     /api/review.cpp \
  13.     /tests/reviewTest.cpp \ 
  14.     /api/reviewList.cpp \
  15.     /tests/reviewListTest.cpp \
  16.     /api/step.cpp \
  17.     /tests/stepTest.cpp \
  18.     /api/preparation.cpp \
  19.     /tests/preparationTest.cpp \
  20.     /api/recipe.cpp \
  21.     /tests/recipeTest.cpp \
  22.     /api/cookBook.cpp \
  23.     /tests/cookBookTest.cpp \
  24.     /plugins/createCookBook.cpp \
  25.     /plugins/printerUnformatted.cpp
  26. DEP := $(SOURCES:.cpp=.d)
  27. OBJECTS := $(SOURCES:.cpp=.o)
  28. EXE := cookBook
  29. CC := g++ -Wall
  30.  
  31. all: $(EXE)
  32.  
  33. %.d:%.cpp
  34.     $(CC) -MM $< -o $@
  35.  
  36. include $(DEP)
  37.  
  38. $(EXE): $(OBJECTS)
  39.     $(CC) -o $@ $?
  40.  
  41.  
  42. $(OBJECTS):
  43.     $(CC) -c -o $@ $<
  44.  
  45. .PHONY: clean
  46. clean:
  47.     rm -f cookBook *.o *.d
  48.  
  49. .PHONY: doc
  50. doc:
  51.     rm -f *.d
  52.     @doxygen
  53.  
  54.  
That is the makefile i'm using.
The error i'm getting is the following:

tom@tomP:~/UNI-FILES/2ba/Gevorderd_Programeren/CookingBook/src$ make
Makefile:14: *** commands commence before first target. Stop.

Now, i have absolutely no idea what i am doing wrong. I'd just like to be able to split my code over different maps and still keep the makefile logic reasonably simple.

Does anyone have any suggestions on how to do this ? I'm really tired of trying to figure this out. I've tried before, i've tried again now. But I just can't think of what i'm doing wrong.
And probably it's something really simple and stupid, I just don't know what.

Any help is really appreciated.
Thanks a million in advance !!!

-Tom
Dec 22 '07 #1
0 2060

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Alex | last post by:
I've just noticed that directories in Unix have different sizes whereas in Windows they don't. Why is this so? Thanks. Alex.
2
by: Mike Metzger | last post by:
I've been running an Access2000 database for a couple years on a Win2k machine fine. We tried to copy the database over to another machine that already had Access2000 installed. When we tried to...
3
by: K.S.Liang | last post by:
Hi all, 1> If there are more than one dynamic linking libraries in the file system, how do I know which one is loaded into system? Any C library or system call can tell me which *.so or *.sl is...
22
by: markus | last post by:
Hi, There are more than 1000 defined system calls in the Unix standard specification, however, a majority of them are optional and the availability of system calls are dependent on the OS...
4
by: foodic | last post by:
I am new to make file concepts. All I need to know whether Is it possible to extract missing directories in the source while executing make -n?For example missing text-utils directory in my...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
2
by: xahlee | last post by:
In this week i wrote a emacs program and tutorial that does archiving a website for offline reading. (See http://xahlee.org/emacs/make_download_copy.html ) In the process, i ran into a problem...
65
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current directory) in C programming language and under Unix, but...
1
RRick
by: RRick | last post by:
I have a unix C++ project that needs to be converted over to windows visual studio. I'm not sure of the exact version of VS, but it's a recent version, probabIy 2003 or 2005. I would like the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.