-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake
50 lines (39 loc) · 858 Bytes
/
make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Makefile for rpal_final
# Compiler and flags
CXX := g++
CXXFLAGS := -std=c++17
# select the operating system
ifeq ($(OS),Windows_NT)
RM = del /Q
RM_CLEAN = del /Q *.o rpal20.exe
else
RM_CLEAN = rm -f *.o rpal20
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
RM = rm -f
endif
ifeq ($(UNAME_S),Darwin)
RM = rm -f
endif
endif
# Source files and object files
SRCS := asttost.cpp cse.cpp flattenst.cpp lexicon.cpp psg.cpp rpal-interpreter.cpp
OBJS := $(SRCS:.cpp=.o)
# Header files
HDRS := asttost.hpp cse.hpp flattenst.hpp lexicon.hpp psg.hpp
# Target executable
TARGET := rpal20
# Default target
all: $(TARGET)
# Linking
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS)
$(RM) *.o
# Compiling source files
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
# Header dependencies
$(OBJS): $(HDRS)
# Clean
clean:
$(RM_CLEAN)