]> Nishi Git Mirror - serenade.git/commitdiff
add files
authornishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Tue, 23 Apr 2024 02:35:14 +0000 (02:35 +0000)
committernishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Tue, 23 Apr 2024 02:35:14 +0000 (02:35 +0000)
git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@6 0f02c867-ac3d-714e-8a88-971ba1f6efcf

Serenade/main.c
Serenade/serenade.h [new file with mode: 0644]
Tool/Makefile

index fbe86a7a32b2a056bca823e5d5cf84e1f6a7fa76..1f9d39a7ecfe8c0c1f1bb8148a7f31fcf74e8889 100644 (file)
 /* -------------------------------------------------------------------------- */
 /* --- END LICENSE --- */
 
-int main(){}
+#include "serenade.h"
+
+#include <string.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+int main(int argc, char** argv){
+       int i;
+       bool loaded = false;
+       for(i = 1; i < argc; i++){
+               if(argv[i][0] == '-'){
+                       if(strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-V") == 0){
+                               printf("Serenade LISP %s\n", SERENADE_VERSION);
+                               return 1;
+                       }else{
+                               fprintf(stderr, "%s: %s: invalid option\n", argv[0], argv[i]);
+                               return 1;
+                       }
+               }else{
+                       /* file input */
+                       loaded = true;
+               }
+       }
+       if(!loaded){
+               printf("Welcome to Serenade LISP %s\n", SERENADE_VERSION);
+       }
+}
diff --git a/Serenade/serenade.h b/Serenade/serenade.h
new file mode 100644 (file)
index 0000000..056972e
--- /dev/null
@@ -0,0 +1,10 @@
+/* $Id$ */
+/* --- START LICENSE --- */
+/* --- END LICENSE --- */
+
+#ifndef __SERENADE_SERENADE_H__
+#define __SERENADE_SERENADE_H__
+
+#define SERENADE_VERSION "0.0"
+
+#endif
index 197d32f315d2ad940d293ffed6bbcc789215b4ae..39e4ec6437cd691e5422872af5e648878f345f3d 100644 (file)
@@ -10,7 +10,7 @@ all: ./configgen
 ./configgen: $(CONFIGGEN_OBJS)
        cc -o $@ $(CONFIGGEN_OBJS)
 
-.c.o:
+.c.o: ../config.h
        cc -c -o $@ $<
 
 clean: