-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmakefile
More file actions
80 lines (59 loc) · 1.8 KB
/
makefile
File metadata and controls
80 lines (59 loc) · 1.8 KB
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
# ------------------------------------------------------------------------------
#
# Makefile for OpenBGI
#
# ------------------------------------------------------------------------------
# Name of the executable
TARGET := openbgi.dll
# Directories
SRCDIR := src
BUILDDIR := bin
TOOLSDIR := tools
# Tools
TOOLS := $(TOOLSDIR)/inject
# C sources
CSOURCES := $(shell find $(SRCDIR) -name '*.c')
# Additional libraries
LIBRARIES :=
# ------------------------------------------------------------------------------
#
# Tools
#
# ------------------------------------------------------------------------------
# Compile & Link, Compile, Assemble and Link utilities
CC = i686-w64-mingw32-gcc-win32
# Compiler, assembler and linker options
CFLAGS = -O3
LDFLAGS = -O3 -shared -static-libgcc -lwinmm -lgdi32
# System utilities
RM = rm -f
# ------------------------------------------------------------------------------
#
# Flags and argument finalization
#
# ------------------------------------------------------------------------------
# Finalizing flags
CFLAGS += $(patsubst %,-I%,$(INCDIR))
# Get object names
OBJS_ = $(CSOURCES:.c=.o)
OBJS = $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(OBJS_)) $(LIBRARIES)
PATHS = $(sort $(dir $(OBJS)))
# ------------------------------------------------------------------------------
#
# Targets
#
# ------------------------------------------------------------------------------
all: setup $(TOOLS) $(BUILDDIR)/$(TARGET)
setup:
mkdir -p $(PATHS)
$(BUILDDIR)/$(TARGET): $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) -o $(BUILDDIR)/$(TARGET)
$(BUILDDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c -o $@ $<
$(TOOLS):
echo $@
$(MAKE) -C $@
clean:
$(RM) $(OBJS) $(BUILDDIR)/$(TARGET)
.PHONY: all setup $(TOOLS)
# EOF --------------------------------------------------------------------------