determing architecture in a makefile

I have a program that I'd like to build on both intel and ppc Macs running Leopard.

I'd like to have my makefile handle the job. I tried to determine the architecture by ..

ARCH = $(if $(findstring i386,$(MACHTYPE)),i386,powerpc)

But within the makefile MACHTYPE is empty. From the terminal, I get what I'd expect.

$ echo $MACHTYPE
i386-apple-darwin9.0

My eventual goal is to define a library for g95

FLIB = -L/sw/lib/gcc-lib/$(ARCH)-apple-darwin9/4.0.3/ -lf95

If anyone can help, I'd appreciate it.

TiA

Intel MacBook Pro, G4 Powerbook, Mac OS X (10.5.7)

Posted on Aug 4, 2009 7:36 PM

Reply
11 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

determing architecture in a makefile

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.