31 lines
587 B
Makefile
31 lines
587 B
Makefile
CC=gcc
|
|
CXX=g++
|
|
CFLAGS=-MD -MP -gdwarf-4 -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 test
|
|
|
|
test: test.o test2.o
|
|
$(CC) -o $@ $^
|
|
|
|
debugus: $(OBJS) ./mujs/build/debug/libmujs.o ./libelfin_wrap.o
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
./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 test2.o $(DEPS)
|
|
rm -f $^
|
|
make -C mujs clean
|
|
|
|
.PHONY: all clean
|
|
|