mirror of
https://github.com/samsonjs/csc360-a1-shell.git
synced 2026-03-25 08:45:52 +00:00
Replace Ruby's old wordexp-like command splitting with a tokenizer and
parser that understands ; and && while honoring quotes and nesting.
Implement richer expansions for command substitution, arithmetic,
parameter defaults (${var:-...}), brace expansion, and escaped
dollar/backtick behavior via shared quote-state handling.
Expand the test suite with parser/expansion edge cases, escaping
parity checks, builtin usage validation, and job-control refresh tests.
Keep C green by adding a compat test profile for c/Makefile test and
by returning nonzero on builtin failures in -c mode, including clearer
`bg` usage output.
16 lines
381 B
Makefile
16 lines
381 B
Makefile
CFLAGS = -Wall -g
|
|
CPPFLAGS = -I$(shell ./dependency-dir)/readline/include
|
|
LDFLAGS = -L$(shell ./dependency-dir)/readline/lib
|
|
|
|
OBJS = utils.o builtins.o exec.o jobs.o main.o
|
|
|
|
all: a1
|
|
|
|
a1: $(OBJS)
|
|
$(CC) $(CFLAGS) -o a1 $(OBJS) $(LDFLAGS) -lreadline -lhistory -ltermcap
|
|
|
|
test: a1
|
|
cd ../ruby && A1_PATH=../c/a1 A1_TEST_PROFILE=compat bundle exec rake test
|
|
|
|
clean:
|
|
rm -rf $(OBJS) a1
|