diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-10 13:40:15 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-10 13:40:15 +0100 |
| commit | d2f37b5965d5c122bbc0e86e0e91b0d631012325 (patch) | |
| tree | 888277f57ea7518d507a5df17b1c679e10f8aac9 /smash | |
| parent | b6e7782be4a7e5d6e4b40787f0bb4e5c65e99520 (diff) | |
Make autobootstrap system
Diffstat (limited to 'smash')
| -rw-r--r-- | smash/.gitignore | 1 | ||||
| -rw-r--r-- | smash/Makefile | 30 |
2 files changed, 15 insertions, 16 deletions
diff --git a/smash/.gitignore b/smash/.gitignore index be6c11f..5c6ad37 100644 --- a/smash/.gitignore +++ b/smash/.gitignore @@ -1,2 +1,3 @@ smash test +objects diff --git a/smash/Makefile b/smash/Makefile index b8fb606..0f90909 100644 --- a/smash/Makefile +++ b/smash/Makefile @@ -1,20 +1,18 @@ -default_target: all +SRC=$(wildcard *.c) +OBJ=$(SRC:%.c=objects/%.o) +CFLAGS=-static -nostdlib -fno-stack-protector -Wno-implicit-function-declaration -fno-builtin -g -unit_test_parser: - gcc parser.c ../lib/slib.a -static -nostdlib -fno-stack-protector -Wno-implicit-function-declaration -o test -DPARSER_UNIT_TEST -g - ./test +default_target: smash -unit_test_variables: - gcc variables.c ../lib/slib.a -static -nostdlib -fno-stack-protector -o test -DVARIABLES_UNIT_TEST -g - ./test +objects/%.o: %.c + @echo Building $< + @-mkdir -p $$(dirname $@) + @gcc -c $< -o $@ ${CFLAGS} -unit_test_builtin: - gcc builtin.c ../lib/slib.a -static -nostdlib -fno-stack-protector -Wno-implicit-function-declaration -o test -DBUILTIN_UNIT_TEST -g - ./test +smash: ${OBJ} + @echo Buliding Smash + @gcc ${OBJ} ../lib/slib.a -o smash ${CFLAGS} -unit_test_exec: - gcc exec.c builtin.c parser.c ../lib/slib.a -static -nostdlib -fno-stack-protector -Wno-implicit-function-declaration -o test -DEXEC_UNIT_TEST -g - ./test - -all: - gcc main.c env.c comment.c exec.c parser.c builtin.c ../lib/slib.a -static -nostdlib -fno-stack-protector -Wno-implicit-function-declaration -fno-builtin -o smash -DVARIABLES_UNIT_TEST -g +clean: + @echo Cleaning Up Smash + @rm -r objects smash |