-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (79 loc) · 2.55 KB
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#******************************************************************************
# Binary Arrays Editor
#******************************************************************************
# @file Makefile
# A script used by GNU Make to recompile the project.
# @par Purpose:
# Allows to invoke "make all" or similar commands to compile all
# source code files and link them into executable file.
# @par Comment:
# None.
# @author Tomasz Lis
# @date 01 Mar 2002 - 01 Jul 2013
# @par Copying and copyrights:
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#******************************************************************************
OS = $(shell uname -s)
ifneq (,$(findstring MINGW,$(OS)))
BARRED_RES = obj/barred_stdres.res
EXEEXT = .exe
else
BARRED_RES =
EXEEXT =
endif
CPP = g++
CC = gcc
WINDRES = windres
DLLTOOL = dlltool
BARRED_BIN = bin/barred$(EXEEXT)
BARRED_LIBS =
BARRED_OBJS = \
obj/barred.o \
$(BARRED_RES)
LINKLIB = -static -lpdcurses
INCS =
CXXINCS =
# flags to generate dependency files
DEPFLAGS = -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
# code optimization flags
OPTFLAGS = -O3
DBGFLAGS =
# linker flags
LINKFLAGS = -std=c++11
# compiler warning generation flags
WARNFLAGS = -Wall -Wno-sign-compare -Wno-unused-parameter
# disabled warnings: -Wextra -Wtype-limits
CXXFLAGS = $(CXXINCS) -std=c++11 -c -fmessage-length=0 $(WARNFLAGS) $(DEPFLAGS) $(OPTFLAGS)
CFLAGS = $(INCS) -c -fmessage-length=0 $(WARNFLAGS) $(DEPFLAGS) $(OPTFLAGS)
LDFLAGS = $(LINKLIB) $(OPTFLAGS) $(DBGFLAGS) $(LINKFLAGS)
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BARRED_BIN) all-after
clean: clean-custom
-${RM} $(BARRED_OBJS) $(BARRED_BIN) $(BARRED_RES) $(BARRED_LIBS)
-@echo ' '
$(BARRED_BIN): $(BARRED_OBJS) $(BARRED_LIBS)
@echo 'Building target: $@'
$(CPP) $(BARRED_OBJS) -o "$@" $(LDFLAGS)
@echo 'Finished building target: $@'
@echo ' '
obj/%.o: src/%.cpp
@echo 'Building file: $<'
$(CPP) $(CXXFLAGS) -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
obj/%.o: src/%.c
@echo 'Building file: $<'
$(CC) $(CFLAGS) -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
obj/%.res: res/%.rc
@echo 'Building resource: $<'
$(WINDRES) -i "$<" --input-format=rc -o "$@" -O coff
@echo 'Finished building: $<'
@echo ' '
#******************************************************************************