Files
wassembly/makefile

32 lines
587 B
Makefile

CC = g++
CFLAGS = -g -std=c++17 -Wall -Wextra -Iinclude
LFLAGS =
CPPS = $(shell find src/ -name '*.cpp')
OBJS = $(patsubst src/%.cpp, build/%.o, ${CPPS})
DEPS = $(patsubst src/%.cpp, build/%.d, ${CPPS})
BINARY = bin/wassembler
.PHONY: all check clean
all: ${BINARY}
check: ${BINARY}
./$< ./bin/test.wasm -e
./$< ./bin/helloworld.wasm -c -o ./bin/test.bin
./$< ./bin/test.bin -e -pb
clean:
-rm -rf build ./${BINARY}
${BINARY}: ${OBJS}
mkdir -p ${@D}
${CC} ${CFLAGS} $^ ${LFLAGS} -o $@
build/%.o: src/%.cpp
mkdir -p ${@D}
${CC} ${CFLAGS} -MMD -c $< -o $@
-include ${DEPS}