aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/compile_parsers.makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/compile_parsers.makefile b/scripts/compile_parsers.makefile
index a3d495885..8b5b31a29 100644
--- a/scripts/compile_parsers.makefile
+++ b/scripts/compile_parsers.makefile
@@ -22,21 +22,25 @@ else
rmf = rm -rf $(1)
endif
-ifneq ($(wildcard src/*.cc),)
+ifneq ($(wildcard $(SRC_DIR)/*.cc),)
LDFLAGS += -lstdc++
endif
-OBJECTS := parser.o scanner.o
+OBJECTS := parser.o
+
+ifneq ($(wildcard $(SRC_DIR)/scanner.*),)
+ OBJECTS += scanner.o
+endif
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
-%.o: src/%.c
+%.o: $(SRC_DIR)/%.c
$(CC) -c $(CFLAGS) -I$(SRC_DIR) -o $@ $<
-%.o: src/%.cc
+%.o: $(SRC_DIR)/%.cc
$(CC) -c $(CXXFLAGS) -I$(SRC_DIR) -o $@ $<
clean: