src/utils/newProg/newProg.c 1.27

1.27 2009/03/30 17:21:33 hiram
Improve the makefile created, add compile target, shorten compile command
Index: src/utils/newProg/newProg.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/newProg/newProg.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -b -B -U 4 -r1.26 -r1.27
--- src/utils/newProg/newProg.c	27 Jun 2008 18:46:54 -0000	1.26
+++ src/utils/newProg/newProg.c	30 Mar 2009 17:21:33 -0000	1.27
@@ -190,11 +190,12 @@
 "%s\n"
 "MYLIBDIR = %s/lib/${MACHTYPE}\n"
 "%s\n"
 "\n"
+"A = %s\n"
 "O = %s.o\n"
 "\n"
-, upLevel, L, upLevel, myLibs, progName);
+, upLevel, L, upLevel, myLibs, progName, progName);
 
 if (cgi)
     {
     fprintf(f, 
@@ -203,23 +204,25 @@
     "include %s/inc/cgi_build_rules.mk\n"
     "\n"
     , progName, upLevel);
     fprintf(f,
-    "compile: $O \n"
+    "compile:: $O\n"
     "\t${CC} $O ${MYLIBS} ${L}\n"
     "\tmv ${AOUT} $A${EXE}\n"
     "\n");
     }
 else
     {
     fprintf(f, 
-    "%s: $O ${MYLIBS}\n"
-    "\t${CC} ${COPT} -o ${BINDIR}/%s $O ${MYLIBS} $L\n"
-    "\t${STRIP} ${BINDIR}/%s${EXE}\n"
+    "%s: ${O} ${MYLIBS}\n"
+    "\t${CC} ${COPT} -o ${DESTDIR}${BINDIR}/${A}${EXE} $O ${MYLIBS} $L\n"
+    "\t${STRIP} ${DESTDIR}${BINDIR}/${A}${EXE}\n"
     "\n"
-    "clean:\n"
-    "\trm -f $O\n"
-    , progName, progName, progName);
+    "compile:: ${O}\n"
+    "\t${CC} ${COPT} -o ${A}${EXE} ${O} ${MYLIBS} $L\n"
+    "\n"
+    "clean::\n"
+    "\trm -f ${A} ${O}\n", progName);
     }
 
 
 fclose(f);