        - assign CC only if not already defined
        - add CFLAGS and LDFLAGS instead of replacing them
        - allow for specifying DESTDIR to 'make install'
        - drop the local subdir (openadk doesnt use this path)
        - create the directories to install into
--- tptest-3.1.7.orig/apps/unix/server/Makefile	2003-01-22 11:42:45.000000000 +0100
+++ tptest-3.1.7/apps/unix/server/Makefile	2010-01-28 00:00:23.000000000 +0100
@@ -1,4 +1,4 @@
-CC		= gcc
+CC		?= gcc
 #
 #      Use this for Linux and other systems that have makedepend
 #      instead of mkdep.
@@ -25,8 +25,8 @@ EXTRADEFINES	= -DUNIX -DLINUX
 #
 #EXTRADEFINES	= -DUSE_GMTIME
 
-CFLAGS		= ${CDEBUG} ${EXTRADEFINES} ${INCL} -Wall
-LDFLAGS		= ${CDEBUG}
+CFLAGS		+= ${CDEBUG} ${EXTRADEFINES} ${INCL} -Wall
+LDFLAGS		+= ${CDEBUG}
 LIBDIR		= 
 LOCLIBS		= 
 
@@ -66,7 +66,8 @@ clean:
 	rm -f tptestserver core *.o *.BAK *.bak *.CKP a.out tpio_unix.c tpengine.c tpcommon.c
 
 install:
-	install -c -s -o bin -g bin -m 555 tptestserver /usr/local/bin
+	install -d -m 755 ${DESTDIR}/usr/bin
+	install -c -m 755 tptestserver ${DESTDIR}/usr/bin
 
 depend: 
 	${MAKEDEPEND} ${INCL} ${SRCS} ${LIBSRCS}
