-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (21 loc) · 835 Bytes
/
Copy pathMakefile
File metadata and controls
28 lines (21 loc) · 835 Bytes
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
# currently works on macOS, make sure to include prereq in README.md
# plan: work in windows (wsl) and linux
# edit: just needs to be known at compile time, look into downloadin
#FILE := include/json.hpp
#FILE_URL := https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/single_include/nlohmann/json.hpp
CXX := g++
CXXFLAGS := -std=c++11 -Wall -Iinclude
SOURCES := main.cpp
OBJECTS := $(SOURCES:.cpp=.o)
JSON_HEADER := include/nlohmann/json.hpp
JSON_URL := https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/single_include/nlohmann/json.hpp
all: $(JSON_HEADER) $(OBJECTS)
$(CXX) $(CXXFLAGS) -o main $(OBJECTS)
$(JSON_HEADER):
@echo "Downloading nlohmann/json.hpp..."
@mkdir -p include/nlohmann
curl -L -o $(JSON_HEADER) $(JSON_URL)
clean:
rm -f main $(OBJECTS)
distclean: clean
rm -rf include