-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
35 lines (27 loc) · 790 Bytes
/
Copy pathmakefile
File metadata and controls
35 lines (27 loc) · 790 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
29
30
31
32
33
34
35
CXX ?= g++
WINDRES := windres
CXXFLAGS ?= -Os -Wall -Wextra -std=c++11 -fdata-sections -ffunction-sections
CPPFLAGS ?= -Iinclude -Iresource
ifeq ($(OS),Windows_NT)
EXEEXT := .exe
PLATFORM_LIBS := -lws2_32
RESOURCES := resource/dv4mini.rc
RESOURCE_OBJ := resource/dv4mini.o
else
EXEEXT :=
PLATFORM_LIBS :=
RESOURCES :=
RESOURCE_OBJ :=
endif
TARGET := dv4mini-hs$(EXEEXT)
SOURCES := $(wildcard source/*.cpp)
HEADERS := $(wildcard include/*.h)
.PHONY: all clean
all: $(TARGET)
@echo Build successful: $(TARGET)
$(RESOURCE_OBJ): $(RESOURCES) resource/dv4mini.h
$(WINDRES) -i $< -o $@
$(TARGET): $(SOURCES) $(HEADERS) $(RESOURCE_OBJ)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(SOURCES) $(RESOURCE_OBJ) -o $@ $(PLATFORM_LIBS) -Wl,--gc-sections -s
clean:
rm -f $(TARGET) $(RESOURCE_OBJ)