26 lines
646 B
Makefile
26 lines
646 B
Makefile
TARGET = cDrive
|
|
CC = gcc
|
|
|
|
SRCS := src src/drive qrcodegen
|
|
|
|
VPATH := $(foreach dir,$(SRCS),$(CURDIR)/$(dir))
|
|
CFILES := $(foreach dir,$(SRCS),$(notdir $(wildcard $(dir)/*.c)))
|
|
CPPFILES := $(foreach dir,$(SRCS),$(notdir $(wildcard $(dir)/*.cpp)))
|
|
OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o)
|
|
|
|
INCLUDES := -I$(CURDIR)/include -I$(CURDIR)
|
|
CFLAGS := -s -Wall $(INCLUDES) `curl-config --cflags`
|
|
CXXFLAGS := $(CFLAGS) -fno-rtti -std=c++17
|
|
LDFLAGS := `curl-config --libs` -lmbedcrypto -lfmt
|
|
|
|
.PHONY: all
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(OFILES)
|
|
$(CXX) -o $@ $^ $(LDFLAGS)
|
|
|
|
run: all
|
|
@./$(TARGET)
|
|
|
|
clean:
|
|
$(RM) $(OFILES) $(TARGET)
|