2023-07-06 11:48:59 +01:00
|
|
|
CC= ../05/tcc-0.9.27/tcc
|
|
|
|
TCCINST= ../05/tcc-bootstrap
|
|
|
|
MUSLINST= ../05/musl-bootstrap
|
2023-09-19 11:42:10 +01:00
|
|
|
LUAINST= deps/lua-bootstrap
|
2023-07-06 11:48:59 +01:00
|
|
|
|
2023-09-19 11:42:10 +01:00
|
|
|
CFLAGS= -I $(MUSLINST)/include -I $(LUAINST)/include -I deps/lpeglabel
|
2023-07-06 11:48:59 +01:00
|
|
|
SRCS = $(sort $(wildcard **/*.c))
|
|
|
|
OBJS = $(SRCS:.c=.o)
|
|
|
|
|
2025-04-05 10:55:40 +01:00
|
|
|
all: test.out #zsh
|
2023-07-06 11:48:59 +01:00
|
|
|
|
2025-04-05 10:55:40 +01:00
|
|
|
test.out: test.s.o test.c.o
|
|
|
|
$(TCC) -static -nostdlib -B ../tcc-boostrap -I ../musl-bootstrap/include ../musl-bootstrap/lib/*.[oa] test.s.o test.c.o -o test.out
|
|
|
|
test.s.o: $(TCC0) test.s
|
|
|
|
$(TCC) -static -nostdlib -B ../tcc-boostrap -I ../musl-bootstrap/include ../musl-bootstrap/lib/*.[oa] -c test.s -o test.s.o
|
|
|
|
test.c.o: $(TCC0) test.c
|
|
|
|
$(TCC) -static -nostdlib -B ../tcc-boostrap -I ../musl-bootstrap/include ../musl-bootstrap/lib/*.[oa] -c test.c -o test.c.o
|
2023-07-06 11:48:59 +01:00
|
|
|
|
2025-04-05 10:55:40 +01:00
|
|
|
# deps/lua-bootstrap/lib/liblua.a:
|
|
|
|
# $(MAKE) -j8 -C deps/lua-5.4.6
|
|
|
|
# $(MAKE) -C deps/lua-5.4.6 install
|
2023-09-19 11:42:10 +01:00
|
|
|
|
2025-04-05 10:55:40 +01:00
|
|
|
# deps/lpeglabel/lpeglabel.a: deps/lua-bootstrap/lib/liblua.a
|
|
|
|
# $(MAKE) -C deps/lpeglabel
|
2023-07-06 11:48:59 +01:00
|
|
|
|
2025-04-05 10:55:40 +01:00
|
|
|
# %.o: %.c deps/lua-bootstrap/lib/liblua.a
|
|
|
|
# $(CC) $(CFLAGS) -c -o $@ $<
|
2023-07-06 11:48:59 +01:00
|
|
|
|
2025-04-05 10:55:40 +01:00
|
|
|
# zsh: $(OBJS) deps/lua-bootstrap/lib/liblua.a deps/lpeglabel/lpeglabel.a
|
|
|
|
# $(CC) -nostdlib -B $(TCCINST) -o zsh $(OBJS) deps/lpeglabel/lpeglabel.a $(LUAINST)/lib/liblua.a $(MUSLINST)/lib/*.[oa]
|
|
|
|
|
|
|
|
# run: zsh
|
|
|
|
# ./zsh
|
2023-07-06 11:48:59 +01:00
|
|
|
|
|
|
|
c:
|
|
|
|
rm -f zsh
|
|
|
|
rm -f src/*.o
|
2023-09-19 11:42:10 +01:00
|
|
|
rm -f deps/lpeglabel/*.o
|
2023-07-06 11:48:59 +01:00
|
|
|
|
|
|
|
clean: c
|
2023-09-19 11:42:10 +01:00
|
|
|
rm -rf deps/lua-bootstrap
|
|
|
|
$(MAKE) -C deps/lua-5.4.6 clean
|
|
|
|
$(MAKE) -C deps/lpeglabel clean
|
2023-07-06 11:48:59 +01:00
|
|
|
|