Hi All,

We need to port few C programs for from Solaris to Linux.
Snippet of sample Makefile:
============================
AFLAGS :sh = if [ "${BUILD_ARCH}" = "V9" ]; \
then echo "-xarch=v9"; \
fi
CFLAGS += ${AFLAGS}
|
|
|
Test: Test.o
$(CC) -o Test Test.o $(AFLAGS)

Test.o: Test.c
$(CC) $(CFLAGS) -c -o Test.o Test.c
============================

But it is not working on Linux. After doing googling, I changed the Makefile to
============================
AFLAGS_CMD :sh = if [ "${BUILD_ARCH}" = "V9" ]; \
then echo "-xarch=v9"; \
fi
AFLAGS = $(shell $(AFLAGS_CMD))

CFLAGS += ${AFLAGS}
|
|
|
Test: Test.o
$(CC) -o Test Test.o $(AFLAGS)

Test.o: Test.c
$(CC) $(CFLAGS) -c -o Test.o Test.c
============================

And now it works fine on Linux. But gives problem on Solaris. Is there is a way to write common makefile for both the platforms?

Thanks in advance,
Kalpana