Avatar of DwayneZandbergen
DwayneZandbergen
 asked on

NMAKE MakeFile ProC Inference Rule

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
   
    .c.obj:
      $(cc) $(cdebug) $(cflags) $(cvars) /I "C:\Oracle\8i\precomp\public" $*.c
   
    .pc.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!  :-)
Editors IDEsCVisual C++.NETMicrosoft DevelopmentC++

Avatar of undefined
Last Comment
itsmeandnobodyelse

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
itsmeandnobodyelse

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes