-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
57 lines (50 loc) · 1.16 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
COMPILER=G++
# todo: object files into output path, processing c / c++ files in the same time (?), nested directories for source files (?)
C = c
OUTPUT_PATH = out/production/superdrive-enabler/
SOURCE_PATH = src/
EXE = $(OUTPUT_PATH)superdrive-enabler
ifeq ($(COMPILER), G++)
ifeq ($(OS),Windows_NT)
OBJ = obj
else
OBJ = o
endif
COPT = -O2
CCMD = g++
OBJFLAG = -o
EXEFLAG = -o
# INCLUDES = -I../.includes
INCLUDES =
# LIBS = -lgc
LIBS =
# LIBPATH = -L../gc/.libs
LIBPATH =
CPPFLAGS = $(COPT) -g $(INCLUDES)
LDFLAGS = $(LIBPATH) -g $(LIBS)
DEP = dep
else
OBJ = obj
COPT = /O2
CCMD = cl
OBJFLAG = /Fo
EXEFLAG = /Fe
# INCLUDES = /I..\\.includes
INCLUDES =
# LIBS = ..\\.libs\\libgc.lib
LIBS =
CPPFLAGS = $(COPT) /DEBUG $(INCLUDES)
LDFLAGS = /DEBUG
endif
OBJS := $(patsubst %.$(C),%.$(OBJ),$(wildcard $(SOURCE_PATH)*.$(C)))
%.$(OBJ):%.$(C)
@echo Compiling $(basename $<)...
$(CCMD) -c $(CPPFLAGS) $(CXXFLAGS) $< $(OBJFLAG)$@
all: $(OBJS)
@mkdir -p $(OUTPUT_PATH)
@echo Linking...
$(CCMD) $(LDFLAGS) $^ $(LIBS) $(EXEFLAG) $(EXE)
clean:
rm -rf $(SOURCE_PATH)*.$(OBJ) $(EXE)
rebuild: clean all
#rebuild is not entirely correct