diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 25 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rwxr-xr-x | configure | 46 | ||||
-rw-r--r-- | docs/builtin_commands.md | 6 | ||||
-rw-r--r-- | docs/syntax.md | 4 | ||||
-rw-r--r-- | mkdocs.yml | 6 |
7 files changed, 50 insertions, 48 deletions
@@ -3,7 +3,7 @@ !/.gitignore build -sgp +geml # Comment these for release. They are generated files using gperf and bison. For # final release they can be in repository. But during development ignore them. @@ -1,15 +1,16 @@ # vim:ts=4:sw=4:noexpandtab MAKEFLAGS += --no-builtin-rules -# Load configuration --include $(O)/.config.mk - # Default output path. Can be changed by enviroment to compile to different folder # than default. O ?= . # This variable can be overwritten to show executed commands Q = @ +# Load configuration +-include $(O)/.config.mk + + # TODO add CROSS_COMPILE support BISON ?= bison CC ?= gcc @@ -17,7 +18,7 @@ CC ?= gcc .PHONY: all -all: $(O)/sgp +all: $(O)/geml # TODO modules @@ -28,11 +29,11 @@ CFLAGS += -Wall CFLAGS += -Iinclude -include $(O)/build/config.h ### Source files list ########################### -SRC = sgp.c \ +SRC = geml.c \ utils.c \ - parser.c \ io.c \ - command.c + command.c \ + parser.c ### End of source files list #################### CSRC = $(patsubst %,src/%,$(filter %.c,$(SRC))) @@ -49,9 +50,9 @@ DEP = $(patsubst src/%.c,$(O)/build/%.d,$(CSRC)) .PHONY: help help: @echo "Simple general preprocessor make targets:" - @echo " all|sgp - Build sgp executable" + @echo " all|geml - Build geml executable" @echo " help - Prints this text help." - @echo " install - Install sgp to you system" + @echo " install - Install geml to you system" @echo " uninstall - Revert install target actions on your system" @echo " clean - Cleans builded files" @echo " distclean - Same as clean but also removes distributed generated files" @@ -75,8 +76,8 @@ uninstall: clean:: @echo " CLEAN build" $(Q)$(RM) -r $(O)/build - @echo " CLEAN sgp" - $(Q)$(RM) $(O)/sgp + @echo " CLEAN geml" + $(Q)$(RM) $(O)/geml .PHONY: distclean distclean:: clean @echo " CLEAN distributed" @@ -112,7 +113,7 @@ $(DEP): $(O)/build/%.d: src/%.c $(Q)$(CC) -MM -MG -MT '$*.o $@' $(CFLAGS) $< -MF $@ endif # DEBUG -$(O)/sgp: $(OBJ) +$(O)/geml: $(OBJ) @echo " LD $@" $(Q)$(CC) $(CFLAGS) $^ -o $@ @@ -1,7 +1,8 @@ -Small General Preprocessor -========================== -This is intended as simple text preprocessor with possible rich feature set for -expanding its capability. +General embedded macro language +=============================== +This project defines simple language embedded in processed text and program for +its execution. It is inspired with C preprocessor, m4 and php although it is +neither. This tool can help you write text, may it be code, website or plain text, with special code embedded. Preprocessor than resolves all code and result is given to @@ -5,19 +5,19 @@ # Described in following format: # name:initial value:type:if exported to makefile:if exported to C header # Where type can be just a string (in C in "") or plain. None implies plain. -CNFS="SGP_VERSION:0.1:string:F:T -SGP_CONTACT:cynerd@email.cz:string:F:T +CNFS="GEML_VERSION:0.1:string:F:T +GEML_CONTACT:cynerd@email.cz:string:F:T PREFIX:/usr/local:string:T:F -MOD_LUA:true::T:F -MOD_PYTHON:true::T:F -DEBUG:false::T:F +MOD_LUA:yes::T:F +MOD_PYTHON:yes::T:F +DEBUG:no::T:F CFLAGS:::T:F LFLAGS:::T:F" ############################################################################ print_help() { echo "Usage: ./configure [OPTION]..." - echo "SGP configuration script. Execute this script to configure project" + echo "GEML configuration script. Execute this script to configure project" echo "and prepare it for building." echo echo " --help, -h Give this help list" @@ -35,8 +35,8 @@ print_help() { echo "Environment variables:" echo " CROSS_COMPILE Prefix for compilation tools." echo - echo "SGP version $SGP_VERSION" - echo "Report bugs to <$SGP_CONTACT>." + echo "GEML version $GEML_VERSION" + echo "Report bugs to <$GEML_CONTACT>." } CONFIG_FILE=.config @@ -60,7 +60,7 @@ OP=c # Parse arguments while [ "$#" -gt 0 ]; do case $1 in - -h|-?|--help) + -h|--help) print_help exit 0 ;; @@ -68,22 +68,22 @@ while [ "$#" -gt 0 ]; do # TODO ;; -d|--debug) - DEBUG=True + DEBUG=yes ;; -r|--release) - DEBUG=False + DEBUG=no ;; --mod-lua-enable) - MOD_LUA=true + MOD_LUA=yes ;; --mod-lua-disable) - MOD_LUA=false + MOD_LUA=no ;; --mod-python-enable) - MOD_PYTHON=true + MOD_PYTHON=yes ;; --mod-python-disable) - MOD_PYTHON=false + MOD_PYTHON=no ;; --op-makefile) OP=m @@ -101,7 +101,7 @@ done # Basically save configuration to file configure() { - echo "# SGP configuration file" > "$CONFIG_FILE" + echo "# GEML configuration file" > "$CONFIG_FILE" echo "# Please do not edit this file directly." >> "$CONFIG_FILE" echo "$CNFS" | while read L; do NAME=`echo "$L" | grep -o -E '^[^:]*'` @@ -116,14 +116,14 @@ doext() { if [ -f "Makefile" ] || [ -f configure ]; then return fi - SGPDIR=`dirname "$0"` + GEMLDIR=`dirname "$0"` - echo "# This is external Makefile for SGP." > Makefile + echo "# This is external Makefile for GEML." > Makefile echo "export CROSS_COMPILE=$CROSS_COMPILE" >> Makefile echo >> Makefile - echo "SGP_PATH = $SGPDIR" >> Makefile + echo "GEML_PATH = $GEMLDIR" >> Makefile echo >> Makefile - echo "MAKEARGS := -C \"\$(SGP_PATH)\"" >> Makefile + echo "MAKEARGS := -C \"\$(GEML_PATH)\"" >> Makefile echo "MAKEARGS += O=\"\$(shell pwd)\"" >> Makefile echo >> Makefile echo "MAKEFLAGS += --no-print-directory" >> Makefile @@ -135,9 +135,9 @@ doext() { echo Created local Makefile - echo "# This is external configure script for SGP." > configure - echo "SGP_PATH=$SGPDIR" >> configure - echo "\$SGP_PATH/configure \$@" >> configure + echo "# This is external configure script for GEML." > configure + echo "GEML_PATH=$GEMLDIR" >> configure + echo "\$GEML_PATH/configure \$@" >> configure chmod +x configure echo Created local configure script diff --git a/docs/builtin_commands.md b/docs/builtin_commands.md index 79222ad..48f5a5b 100644 --- a/docs/builtin_commands.md +++ b/docs/builtin_commands.md @@ -19,8 +19,8 @@ $limit(0)$include(file)$endlimit ``` ### $load(...) -This loads additional modules. sgp searches with precedence for modules in file -directory and in paths defined by environment variable `SGPMODULES`. `NAME` is in +This loads additional modules. Geml searches with precedence for modules in file +directory and in paths defined by environment variable `GEMLMODULES`. `NAME` is in such case relative path to module, but also absolute path can be used. Be aware that modules stays loaded even after current file preprocessing is @@ -100,7 +100,7 @@ specify any shell command in `CMD`. `TEXT` is printed to error output and spg is terminated. ### $warning(TEXT) -`TEXT` is printed to error output, but sgp continuous preprocessing text. +`TEXT` is printed to error output, but geml continuous preprocessing text. ### $info(TEXT) Simply prints `TEXT` to standard output. If standard output is used as output of diff --git a/docs/syntax.md b/docs/syntax.md index fa00287..1f195ed 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -53,8 +53,8 @@ Special macros -------------- These macros has special meaning. They can't be redefined, but can be overloaded using modules. And they are not defined in processed text. -### SGP_VERSION -Expands to version of sgp tool. +### GEML_VERSION +Expands to version of geml tool. ### FILE Expands to name of file that is processed. This macro is not changing during whole preprocessing. Note that you can use it in included files to identify name of @@ -1,6 +1,6 @@ -site_name: SGP -repo_url: https://github.com/Cynerd/sgp.git -site_description: Simple genetal preprocessor +site_name: GEML +repo_url: https://github.com/Cynerd/geml.git +site_description: General embedded macro language copyright: GNU General Public License, version 2.0 pages: - Home: index.md |