ftpiiu_plugin/Makefile.linux

37 lines
1.1 KiB
Makefile
Raw Normal View History

2020-04-06 07:36:03 +02:00
TARGET := linux/ftpd
BUILD := linux/build
2020-04-05 21:16:16 +02:00
2020-04-06 07:36:03 +02:00
CFILES := $(wildcard source/linux/*.c)
2020-04-05 21:16:16 +02:00
OFILES := $(patsubst source/%,$(BUILD)/%,$(CFILES:.c=.c.o))
2020-04-06 07:36:03 +02:00
CXXFILES := $(wildcard source/*.cpp source/imgui/*.cpp source/linux/*.cpp)
2020-04-05 21:16:16 +02:00
OXXFILES := $(patsubst source/%,$(BUILD)/%,$(CXXFILES:.cpp=.cpp.o))
2020-04-06 07:36:03 +02:00
CPPFLAGS := -g -Wall -pthread -Iinclude -Isource/linux \
2020-04-05 21:16:16 +02:00
`pkg-config --cflags gl glfw3` \
-DSTATUS_STRING="\"ftpd v$(VERSION)\"" \
-DIMGUI_DISABLE_INCLUDE_IMCONFIG_H=1 \
-DIMGUI_IMPL_OPENGL_LOADER_GLAD=1
CFLAGS := $(CPPFLAGS)
CXXFLAGS := $(CPPFLAGS) -std=gnu++17
LDFLAGS := -pthread `pkg-config --libs gl glfw3` -ldl
2014-11-25 07:13:47 +01:00
.PHONY: all clean
2020-04-05 21:16:16 +02:00
all: $(TARGET)
2014-11-25 07:13:47 +01:00
2020-04-05 21:16:16 +02:00
$(TARGET): $(OFILES) $(OXXFILES)
$(CXX) -o $@ $^ $(LDFLAGS)
2014-11-25 07:13:47 +01:00
2020-04-05 21:16:16 +02:00
$(OFILES): $(BUILD)/%.c.o : source/%.c
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(CC) -MMD -MP -MF $(BUILD)/$*.c.d $(CFLAGS) -c $< -o $@
2014-11-25 07:13:47 +01:00
2020-04-05 21:16:16 +02:00
$(OXXFILES): $(BUILD)/%.cpp.o : source/%.cpp
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(CXX) -MMD -MP -MF $(BUILD)/$*.c.d $(CXXFLAGS) -c $< -o $@
2014-11-25 07:13:47 +01:00
clean:
2020-04-05 21:16:16 +02:00
@$(RM) -r $(BUILD) $(TARGET)
-include $(shell find $(BUILD) -name \*.d 2>/dev/null)