473,804 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make utility in Unix. Make over different directories

21 New Member
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_Progr ameren/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 2086

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

Similar topics

7
2730
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
10552
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 run it, we got an error on the following piece of VBA code embedded in a form: ------------------------ With Me .AgeMax = DateDiff("yyyy", Me.dteDateOfBirthMin, Date) .AgeMin = DateDiff("yyyy", Me.dteDateOfBirthMax, Date) End With...
3
4270
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 active? Can the setting of LD_LIBRARY_PATH guanrantee that the correct one is executed? 2> In MS-WINDOWS, once a DLL is loaded by one allication, this DLL will be used by the subsequent appication. Does UNIX have the same
22
2679
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 implementation itself. The question I have is: How do you determine which system calls are available on any Unix/Linux machine?
4
1199
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 source.Or any option available in make that will throw error messages about missing directories when using make -n ? Thanks in advance Divya
6
4906
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
2
1406
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 with the unix “cp” utility. I've been a unix admin for Solaris during 1998-2004. Even the first time i learned about cp, i noticed some pecularity. But only today, i thought about it and wrote it out exactly what's going on. Here's a...
65
5108
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 got errors of Failed to open file ./outdir/mytestout.txt. Below is the code: #include <stdio.h>
1
3838
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 windows directory tree to mimic the unix tree as closely as possible, but I don't want duplicate files and other inconsistencies. I have come up with an idea but I don't know how close it fits a "typical" windows project. If you know of specific...
0
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.