troubleshooting Question

NMAKE MakeFile ProC Inference Rule

Avatar of DwayneZandbergen
DwayneZandbergen asked on
Editors IDEsCVisual C++.NETMicrosoft DevelopmentC++
1 Comment1 Solution1103 ViewsLast Modified:
Does anybody know how to make an inference rule for use in a Visual Studio 8 NMAKE Makefile?  I have one that sort-of works but it requires a bit of pump priming.  Here is an example:

    !include <win32.mak>
    .SUFFIXES: .pc
    all: myapp.exe
    myapp.exe: myapp.obj
      $(link) $(ldebug) $(conflags) -out:myapp.exe myapp.obj C:\Oracle\8i\precomp\lib\orasql8.lib
      $(cc) $(cdebug) $(cflags) $(cvars) /I "C:\Oracle\8i\precomp\public" $*.c
      proc $*.pc

Without myapp.c already existing, it won't catch the pc -> c rule.

    NMAKE : fatal error U1073: don't know how to make 'myapp.obj'

If I have an existing myapp.c file, update the myapp.pc file (thus making it newer) and then do an nmake, it all works fine - it will build all the way through to myapp.exe.  If I don't have the myapp.c file but I, instead, make the app: dependency myapp.c then it will run the proper rule and make myapp.pc.  Build all - the /A option - doesn't make any difference.

If I can't get this working then I'm going to have to specify a rule for each pc -> c and I have a lot of those.

Thanks!  :-)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros