Link to home
Create AccountLog in
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!  :-)
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer