34 lines
764 B
Makefile
34 lines
764 B
Makefile
CC=gcc
|
|
CXX=g++
|
|
CFLAGS=-MD -MP -gdwarf -I./mujs
|
|
LDFLAGS=-lm -ldwarf++ -lelf++ -lstdc++
|
|
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 ./libelfin_wrap.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)
|
|
|
|
./libelfin_wrap.o: ./libelfin_wrap.cpp
|
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
|
|
|
-include $(DEPS)
|
|
|
|
clean: $(OBJS) test.o $(DEPS) .debugusrc1.js
|
|
rm -f $^
|
|
make -C mujs clean
|
|
|
|
.PHONY: all clean
|
|
|