From: nishi Date: Tue, 23 Apr 2024 02:35:14 +0000 (+0000) Subject: add files X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=21bdca01896fa18327e08dcc7fa2d2b1fb759b0f;p=serenade.git add files git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@6 0f02c867-ac3d-714e-8a88-971ba1f6efcf --- diff --git a/Serenade/main.c b/Serenade/main.c index fbe86a7..1f9d39a 100644 --- a/Serenade/main.c +++ b/Serenade/main.c @@ -28,4 +28,30 @@ /* -------------------------------------------------------------------------- */ /* --- END LICENSE --- */ -int main(){} +#include "serenade.h" + +#include +#include +#include + +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 index 0000000..056972e --- /dev/null +++ b/Serenade/serenade.h @@ -0,0 +1,10 @@ +/* $Id$ */ +/* --- START LICENSE --- */ +/* --- END LICENSE --- */ + +#ifndef __SERENADE_SERENADE_H__ +#define __SERENADE_SERENADE_H__ + +#define SERENADE_VERSION "0.0" + +#endif diff --git a/Tool/Makefile b/Tool/Makefile index 197d32f..39e4ec6 100644 --- a/Tool/Makefile +++ b/Tool/Makefile @@ -10,7 +10,7 @@ all: ./configgen ./configgen: $(CONFIGGEN_OBJS) cc -o $@ $(CONFIGGEN_OBJS) -.c.o: +.c.o: ../config.h cc -c -o $@ $< clean: