$(CC) -o ltmain $(OBJ) -lopts
clean :
- rm -f lt*.o ltmain $(GENED) *~
+ rm -rf .libs lt*.o ltmain libtool $(GENED) *~
ltmain.in : $(TXTTPL) ltstr.def
autogen -T ltmain.tpl -l ltmacros.tpl ltstr.def
$(CC) -c -o ltopts.o -I/usr/local/include ltopts.c
gen : ltmain.in ltstr.c ltopts.c
+
+libtool : ltmain
+ ./ltmain --mode=link $(CC) -o $@ $(OBJ) -lopts
descrip = "ltmain's operational mode";
/*
- * BEWARE: these *must* enumerate to the values #define-d in the
- * lt_*.def files!!
+ * Extract the keyword list from the defined list of modes.
+ * This comes from that definition file. This ensures that
+ * the ordering is the same, too. It omits 'base'.
*/
- keyword = /* 0 -> UNDEFINED */
- clean, /* 1 */
- compile, /* 2 */
- execute, /* 3 */
- finish, /* 4 */
- install, /* 5 */
- link, /* 6 */
- uninstall, /* 7 */
- echo; /* 8 */
+#shell
+ echo keyword =
+ egrep -i '^[ ]*str-name' ltstr.def | \
+ sed '/base/d;s/.*=//;s/;.*/,/;$s/,/;/'
+#endshell
+
doc =
"This enumerates all of the libtool operational modes.\n"
"If this option is not specified, then this program tries to infer\n"
AutoGen Definitions ltmain.tpl;
-#define BASE_STRING 0
-
-string[0] = {
+string = {
str-name = base;
};
-#define CLEAN_STRING 1
-
-string[CLEAN_STRING] = {
+string = {
str-name = clean;
explain = "
<command> is the name of the program to use to delete files associated with
the file itself is deleted using <command>.\n";
};
-#define COMPILE_STRING 2
-
-string[COMPILE_STRING] = {
+string = {
str-name = compile;
call-proc = emitCompile;
code suffix `.c' with the library object suffix, `.lo'.\n";
};
-#define EXECUTE_STRING 3
-
-string[EXECUTE_STRING] = {
+string = {
str-name = execute;
call-proc = emitExecute;
Then, <command> is executed, with `<cmd-arg>...' as arguments.\n";
};
-#define FINISH_STRING 4
-
-string[FINISH_STRING] = {
+string = {
str-name = finish;
explain = "
Complete the installation of libtool libraries.\n
the `--dry-run' option if you just want to see what would be executed.\n";
};
-#define INSTALL_STRING 5
-
-string[INSTALL_STRING] = {
+string = {
str-name = install;
explain = "
Install executables or libraries.\n
(only BSD-compatible install options are recognized).\n";
};
-#define LINK_STRING 6
-
-string[LINK_STRING] = {
+string = {
str-name = link;
explain = "
Link object files or libraries together to form another library,
is created, otherwise an executable program is created.\n";
};
-#define UNINSTALL_STRING 7
-
-string[UNINSTALL_STRING] = {
+string = {
str-name = uninstall;
use_explain = clean;
use_cmd = clean;
};
-#define ECHO_STRING 8
-
-string[ECHO_STRING] = {
+string = {
str-name = echo;
explain = "
This is a reimplementation of the echo command.
=]
#include "[=(. hdr-name)=]"
[=
-(define tpl-name "") =][=
+(define tpl-name "")
+(define cmd-list "")
+(define proc-list "")
+(define Cmd-Name "") =][=
-FOR string
+FOR string =][=
+
+ (set! Cmd-Name (string-capitalize! (get "str_name")))
=]
/*
IF (exist? "explain")
=]
-tSCC zExplain[=(string-capitalize! (get "str_name"))=][ [=
+tSCC zExplain[=(. Cmd-Name)=][ [=
(+ 1 (len "explain")) =] ] =
[=(kr-string (get "explain"))=];[=
ENDIF =][=
IF (exist? "explain") =]
[= ENDIF =]
-tSCC z[= (string-capitalize! (get "str_name")) =]Cmd[] =[=
+tSCC z[= (. Cmd-Name) =]Cmd[] =[=
(out-push-new ".lt.sh") =][=
INCLUDE (. tpl-name) =][=
(out-pop)
- (kr-string (shell "cat .lt.sh ; rm -f .lt.sh")) =];
+ (set! cmd-list (string-append cmd-list "z" Cmd-Name "Cmd\n"))
+ (kr-string (shell "cat .lt.sh ; rm -f .lt.sh"))
+ =];
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */[=
+ ELIF (exist? "use_cmd") =][=
+ (set! cmd-list (string-append cmd-list "z"
+ (string-capitalize! (get "use_cmd")) "Cmd\n")) =][=
+ ELSE =][=
+ (set! cmd-list (string-append cmd-list "(tCC*)NULL\n" )) =][=
ENDIF =][=
ENDFOR =][=
[=IF (== (suffix) "h")=]extern [=
ENDIF=]tCC* apz_mode_cmd[ MODE_CT ][=
-IF (== (suffix) "c") =] = {[=
-
- FOR string , =]
- [=
- IF (exist? "use_cmd")
- =]z[=(string-capitalize! (get "use_cmd"))=]Cmd[=
- ELIF (exist? "text")
- =]z[=(string-capitalize! (get "str_name"))=]Cmd[=
- ELSE =](tCC*)NULL[=
- ENDIF =][=
- ENDFOR =]
+IF (== (suffix) "c") =] = {
+[=(shellf "columns -I4 -S, <<_EOF_\n%s_EOF_" cmd-list) =]
}[=
ENDIF =];
IF (== (suffix) "c") =] = {[=
FOR string , =]
- [=
- IF (or (exist? "use_cmd") (exist? "text"))
- =][=?% call-proc "%s" emitScript=][=
- ELSE =](emitScriptProc*)NULL[=
- ENDIF =][=
+ [=?% call-proc "%s" emitScript=][=
ENDFOR =]
};[=