Using GNU autotools process and Oracle Pro C preprocessor

185 Views Asked by At

I am converting a few libs to GNU autotools and having a hard time to integrade Oracle Pro C preprocessor.

The workflow is as follows: .pc => .c => o. => .so/.a/binary

I wasn't able to find any hints in the automake manual how to add an additional pre-steps to the build process. I have tried to modify SOURCES=file.pc but autoreconf complains about missing C files. I have added SUFFIXES = .pc .c .o and

.pc.c:
      $(PROC) iname=$<

But the target is ignored -- and if called directly $< is never resolved.

What to do?

1

There are 1 best solutions below

1
On

Something like this:

%.c : %.pc
        $(PROC) iname=$<

foo.o : foo.pc

seems to work for GNU make. I don't have any other kind of make to test with. IIRC, I think

.SUFFIXES : .pc
.pc.c:
        $(PROC) iname=$<

could work, but I don't have another make to test this out.

I tried this out and it did behave kind of like how you want.

foo_SOURCES= $(top_srcdir)/src/main.c $(top_srcdir)/src/foo.pc

SUFFIXES : .pc
.pc.c:
        $(PROC) iname=$<