• 0

[NMAKE]Sources in different directories.


Question

I have a bunch of source file in a single directory. Also in that directory is a 'Sources' file (for use with MS NMAKE). The 'Sources' file contains (edited for because I don't want anyone to know about it, yet):

TARGETNAME=random_target
TARGETPATH=..\obj
TARGETTYPE=DRIVER
USE_PDB=true
SOURCES= \
	source1.c \
 ? ? ? ?source2.c \
 ? ? ? ?more_sources.c \
 ? ? ? ?close.c 
INCLUDES=.;..\include;$(BASEDIR)\src\filesys\inc;$(BASEDIR)\inc
UMTYPE=nt
C_DEFINES= ? ? ?-DUNICODE -D_CPU_X86_

Now, this compiles and links just fine. Now say I have a subdirectory called 'more_sources' containing more source files. If I edit the 'Sources' file to look like this (look below), it give some stupid error.

TARGETNAME=random_target
TARGETPATH=..\obj
TARGETTYPE=DRIVER
USE_PDB=true
SOURCES= \
	source1.c \
 ? ? ? ?source2.c \
 ? ? ? ?more_sources.c \
 ? ? ? ?close.c \
 ? ? ? ?more_sources\random_source_file.c
INCLUDES=.;..\include;$(BASEDIR)\src\filesys\inc;$(BASEDIR)\inc
UMTYPE=nt
C_DEFINES= ? ? ?-DUNICODE -D_CPU_X86_

My question is, how do I compile source files from a differnt directory to include with this project?

(Sorry if I'm not clear enough)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Try using 'more_sources/random_source_file.c' and not 'more_sources\random_source_file.c'

You should look how winddk samples directory is setup. It has directories and sources files iirc.

Btw, I'm from UW and I guess you are too :cool:

Edited by Andareed
Link to comment
Share on other sites

  • 0
You should look how winddk samples directory is setup. It has directories and sources files iirc.

Btw, I'm from UW and I guess you are too :cool:

The problem with the winddk samples is that all the source files are in the same directory (not very organized).

And yes, UW all the way. I'm going into 2A Co-op CS (B.Math).

Link to comment
Share on other sites

  • 0

Well, that didn't work. I get the error:

BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: Object root set to: ==> objchk_w2K_x86
BUILD: Compile and Link for i386
BUILD: z:\random_location: Ignoring invalid directory prefix in SOURCES= entry: more_sources/random_source_file.c
NMAKE :  U1073: don't know how to make 'objchk_w2K_x86\i386\\random_source_file.obj'
Stop.

Any other ideas?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.