Joel Grunbaum
2021-07-14 592993dcbb6ab134991836734eb68ebbd31c9946
added makefiles
1 files modified
3 files added
50 ■■■■■ changed files
.gitignore 1 ●●●● patch | view | raw | blame | history
Makefile 33 ●●●●● patch | view | raw | blame | history
gens/Makefile 8 ●●●●● patch | view | raw | blame | history
parsers/Makefile 8 ●●●●● patch | view | raw | blame | history
.gitignore
@@ -1,3 +1,4 @@
**~
\#*\#
**.o
docconv
Makefile
New file
@@ -0,0 +1,33 @@
export BUILD_DIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))build
export CXX=g++
export CXXFLAGS=
_OBJS-top=ast.o main.o
DEBUG=a
ifdef DEBUG
    CXXFLAGS+=-g
endif
OBJS-top=$(patsubst %,$(BUILD_DIR)/%,$(_OBJS-top))
.PHONY: directories parser gen clean
default: docconv directories
docconv: parser gen $(OBJS-top)
    $(CXX) $(CXXFLAGS) -o $@ $(BUILD_DIR)/*.o
$(BUILD_DIR)/%.o: %.cpp
    $(CXX) -c $(CXXFLAGS) -o $@ $<
parser: directories
    $(MAKE) -C parsers
gen: directories
    $(MAKE) -C gens
directories:
    mkdir -p $(BUILD_DIR)
clean:
    rm -rf $(BUILD_DIR)
gens/Makefile
New file
@@ -0,0 +1,8 @@
_OBJS-gen=dot.o
export OBJS-gen=$(patsubst %,$(BUILD_DIR)/%,$(_OBJS-gen))
default: $(OBJS-gen)
$(BUILD_DIR)/%.o: %.cpp
    $(CXX) -c $(CXXFLAGS) -o $@ $<
parsers/Makefile
New file
@@ -0,0 +1,8 @@
_OBJS-par=
export OBJS-par=$(patsubst %,$(BUILD_DIR)/%,$(_OBJS-par))
default: $(OBJS-par)
$(BUILD_DIR)/%.o: %.cpp
    $(CXX) -c $(CXXFLAGS) -o $@ $<