30 lines
630 B
Makefile
30 lines
630 B
Makefile
CC=gcc
|
|
CFLAGS=-MD -MP -ggdb -I./mujs
|
|
LDFLAGS=-lm -lelf
|
|
SRCS=debugus.c linenoise.c hash.c pmparser.c
|
|
OBJS=$(patsubst %.c,%.o,$(SRCS))
|
|
DEPS=$(patsubst %.c,%.d,$(SRCS))
|
|
|
|
all: debugus .debugusrc1.js test
|
|
|
|
test: test.o
|
|
$(CC) -gdwarf -o $@ $^
|
|
|
|
debugus: $(OBJS) ./mujs/build/debug/libmujs.o
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
.debugusrc1.js: test .debugusrc1.js.txt
|
|
cat .debugusrc1.js.txt | sed "s/@DUPA_ADDR/0x$$(nm ./test | grep 'dupa' | awk '{ print $$1 }')/g" > .debugusrc1.js
|
|
|
|
./mujs/build/debug/libmujs.o:
|
|
make -C mujs -j$(shell nproc)
|
|
|
|
-include $(DEPS)
|
|
|
|
clean: $(OBJS) test.o $(DEPS)
|
|
rm -f $^
|
|
make -C mujs clean
|
|
|
|
.PHONY: all clean
|
|
|