3 (defun generate-obj-macro (mname &optional postfix
&rest slist
)
4 "Generates a macro definition for an OBJs dependency based on a list of source definitions"
7 ((replist (apply 'append
(mapcar (lambda (sdef)
10 ((def (buffer-substring-no-properties
11 (search-forward (concat sdef
" = \\\n") nil t
)
12 (search-forward "\n\n" nil t
)))
14 (replace-regexp-in-string "^.*\\.h.*\n" "" def
)
15 "\\s-+\\\\?\\|\n" t
)))
17 (def-start (search-forward (concat mname
" = \\\n") nil t
))
18 (def-end (search-forward "\n\n" nil t
))
23 (replace-regexp-in-string
24 "\\(\\s-*\\)\\(.*\\)\\.c" "\\1$(OBJ)\\\\\\2.obj" s
)
28 (concat repl
"\n" postfix
"\n\n")
29 (concat repl
"\n\n")))
31 (delete-region def-start def-end
)