You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
558 B

# Simple Makefile for Math Exam Generator
CXX ?= g++
CXXFLAGS ?= -std=c++17 -Wall -Wextra -O2
LDFLAGS ?= -static -static-libgcc -static-libstdc++
# Cross-platform remove command
ifeq ($(OS),Windows_NT)
RM := cmd /C del /Q
else
RM := rm -f
endif
TARGET := math_exam_generator
SRCS := main.cc app.cc auth.cc exam.cc login.cc utils.cc
OBJS := $(SRCS:.cc=.o)
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
-$(RM) $(OBJS)
%.o: %.cc
$(CXX) $(CXXFLAGS) -c $< -o $@
.PHONY: clean
clean:
-$(RM) $(OBJS) $(TARGET) $(TARGET).exe