]> git.eshelyaron.com Git - emacs.git/commitdiff
(cit-remove-and-do-shared-lib): Enable for use with Make projects too. Create the...
authorzappo <zappo@users.sourceforge.net>
Thu, 15 Oct 2009 02:55:46 +0000 (02:55 +0000)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 17:32:29 +0000 (19:32 +0200)
test/manual/cedet/cit-cpp.el

index 466c032e5b490ae1ea65823c54fed9a17f79633c..e162eaf6d253af670874d09e5ebd5ca55cb99536 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2008, 2009 Eric M. Ludlam
 
 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
-;; X-RCS: $Id: cit-cpp.el,v 1.6 2009-09-14 02:38:13 zappo Exp $
+;; X-RCS: $Id: cit-cpp.el,v 1.7 2009-10-15 02:55:46 zappo Exp $
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
 
   )
 
-(defun cit-remove-add-to-project-cpp ()
-  "Remve foo.cpp from the current project.  Add in a new generated file."
-
-  (find-file (cit-file "src/foo.cpp"))
+(defun cit-remove-add-to-project-cpp (make-type)
+  "Remve bar.cpp from the current project.
+Create a new shared lib with bar.cpp in it.
+Argument MAKE-TYPE is the type of make project to create."
+  (find-file (cit-file "src/bar.cpp"))
   ;; Whack the file
   (ede-remove-file t)
   (kill-buffer (current-buffer))
-  (delete-file (cit-file "src/foo.cpp"))
+  (delete-file (cit-file "src/bar.cpp"))
 
-  ;; Make a new one
-  (cit-srecode-fill-with-stuff "src/bar.cpp" cit-src-cpp-tags)
-  (ede-add-file "Prog")
+  ;; Create a new shared lib target, and add bar.cpp to it.
+  (find-file (cit-file "lib/bar.cpp"))
+  (cit-srecode-fill-with-stuff "lib/bar.cpp" cit-src-cpp-tags)
+  (ede-new make-type "Libs")
+  (ede-new-target "testlib" "sharedobject" "n")
+  (ede-add-file "testlib")
 
   ;; 1 g) build the sources.
   ;; Direct compile to test that make fails properly.
     (accept-process-output)
     (sit-for 1))
 
+  (let ((p (ede-current-project)))
+    (if (string= make-type "Automake")
+       (oset p :variables '( ( "AM_CPPFLAGS" . "-I../include") ))
+      (oset p :variables '( ( "CPPFLAGS" . "-I../include") )))
+    (ede-commit-project p)
+    )
+
   (cit-compile-and-wait)
   )