home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff374.lzh
/
Mat
/
MAKEDEP
< prev
next >
Wrap
Text File
|
1990-10-08
|
1KB
|
31 lines
.K PAT,>/K
.BRA {
.KET }
;; MAKEDEP -- Create dependency lists for C makefiles.
;; Source files are assumed to have the ".c" extension, and #includes
;; to end in either ".h" or ".c". The script is NOT smart enough to do
;; nested includes!
mat #?.c key {PAT}
if WARN
Mat >T:depen "'#include # (?||<)^#?.(h|c)^#?" "^1 " tag ^B@@@^F@^|^B@@@^F@ nolines {PAT}.c
else
Mat >T:depen "'#include # (?||<)^#?.(h|c)^#?" "^1 " tag ^B@@@^F@^|^B@@@^F@ nolines {PAT}
endif
if "{>}" eq ""
Mat @@@^#?^.c@^#? "^B^1.o : ^1.c ^3" T:depen label ^B###
else
Mat >{>} @@@^#?^.c@^#? "^B^1.o : ^1.c ^3" T:depen label ^B###
endif
del T:depen
;; Creating a dependency list in "make" format requires two passes of Mat.
;; The first pass creates a temporary file ("T:depen") that contains one
;; line for each line scanned. After a (probably unnecessary) "@@@" prefix
;; comes the filename, another "@" and all the included filenames found
;; (assumed to end in either ".h" or ".c").
;; The second pass strips the ".c" extension off the filename (it MUST BE
;; a ".c" file!) and rearranges things into a standard dependency line.