File: Makefile

package info (click to toggle)
retroarch 1.7.3%2Bdfsg1-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 49,188 kB
  • sloc: ansic: 600,492; cpp: 23,670; objc: 8,299; asm: 6,404; sh: 2,203; xml: 2,144; makefile: 1,867; python: 1,582; java: 941; perl: 393
file content (160 lines) | stat: -rw-r--r-- 4,446 bytes parent folder | download | duplicates (2)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

TARGET      = com-parse
DEBUG       = 0
GENDEPS     = 1
TARGET_ARCH = amd64
OS         ?= win32


OBJ :=
OBJ += com-parse.o



EXE_EXT := $(suffix $(wildcard $(MAKE).*))

ifeq ($(compiler),)
   ifeq ($(patsubst %.exe,%,$(basename $(CC))),cl)
      compiler = msvc
   else
      compiler = gcc
   endif
endif

CC_OUT  = -o $(NOTHING)
CXX_OUT = $(CC_OUT)
LD_OUT  = $(CC_OUT)
OBJ_EXT := o

ifeq ($(DEBUG),1)
   DEFINES += -DDEBUG -D_DEBUG
endif

ifeq ($(compiler),msvc)
   ARCH        = amd64
   ARCH2        = x64
   TARGET_ARCH2 = x64
   CROSS        = amd64
   WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING)
   WindowsSDKVersion := 10.0.14393.0\$(NOTHING)
   VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING)

   INCLUDE := $(VCINSTALLDIR)include;$(VCINSTALLDIR)atlmfc\include;$(WindowsSdkDir)include\$(WindowsSDKVersion)ucrt;$(WindowsSdkDir)include\$(WindowsSDKVersion)shared;$(WindowsSdkDir)include\$(WindowsSDKVersion)um;
   LIB     := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);$(WindowsSdkDir)lib\$(WindowsSDKVersion)ucrt\$(TARGET_ARCH2);$(WindowsSdkDir)lib\$(WindowsSDKVersion)um\$(TARGET_ARCH2);C:\Program Files (x86)\NVIDIA Corporation\Cg\lib.$(TARGET_ARCH2);C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Lib\$(TARGET_ARCH2);
   LIBPATH := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);

   PATH := $(shell IFS=$$'\n'; cygpath "$(VCINSTALLDIR)bin\\$(CROSS)"):$(shell IFS=$$'\n'; cygpath "$(WindowsSdkDir)\bin\\$(ARCH2)"):$(PATH)

   export INCLUDE := $(INCLUDE)
   export LIB     := $(LIB)
   export LIBPATH := $(LIBPATH)
   export PATH    := $(PATH)

   DEFINES :=
   FLAGS  += -nologo
   FLAGS  += -Gm- -Zc:inline -fp:precise -Zc:forScope -Gd -Oi -volatile:iso
   #FLAGS  += -GR-
   CFLAGS += -TC
   CXXFLAGS += -TP -EHsc
   WARNINGS += -WX -W3
   WARNINGS += -wd4101 -wd4996 -wd4244 -wd4267 -wd4090 -wd4305 -wd4146 -wd4334 -wd4018

   CC = cl.exe
   CXX = cl.exe
   LD = link.exe
   RC = rc.exe
   LIBS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib
   LDFLAGS  += -nologo -wx -nxcompat -machine:$(TARGET_ARCH2)
   ifeq ($(DEBUG),1)
      FLAGS += -GS -Gy -Od -RTC1 -D_SECURE_SCL=1 -Zi
      FLAGS += -MDd
      LDFLAGS += -DEBUG
      DEFINES += -DDEBUG -D_DEBUG
   else
      FLAGS += -GS- -Gy- -O2 -Ob2 -GF -GT -Oy -Ot -D_SECURE_SCL=0
      FLAGS += -MD
   endif
   OBJ := $(OBJ:.o=.obj)
   LDFLAGS += -WX -SUBSYSTEM:WINDOWS -ENTRY:mainCRTStartup
   DEFINES := $(patsubst -f%,,$(DEFINES))
   LDFLAGS := $(patsubst -l%,%.lib,$(LDFLAGS))
   LIBS := $(filter-out -lm,$(LIBS))
   LIBS := $(patsubst -l%,%.lib,$(LIBS))
   DEPFLAGS = -showIncludes | tee $*.dtemp | sed /'Note: including file:'/d
   MAKEDEPS = echo $@: $< \\ > $*.depend && \
              grep 'Note: including file:' $*.dtemp \
              | sed '/$(subst \,\\,$(WindowsSdkDir))/Id; /$(subst \,\\,$(VCINSTALLDIR))/Id; s/Note: including file:[ ]*//g; s/\\/\//g; s/ /\\ /g; s/.*/   & \\/g' \
              >> $*.depend && \
              rm -f $*.dtemp

   OBJ_EXT := obj
   CC_OUT := -Fo:
   CXX_OUT := $(CC_OUT)
   LD_OUT := -out:
else
   RC := windres
   DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILD_DIR)$*.depend
   LD = $(CXX)
   ifeq ($(DEBUG),1)
      FLAGS += -g -O0
   else
      FLAGS += -O3
   endif
endif


INCLUDE_DIRS += -I. -I../../deps/peglib


$(info os       : $(OS))
$(info host     : $(ARCH))
$(info target   : $(TARGET_ARCH))
$(info compiler : $(compiler))

all: $(TARGET)$(EXE_EXT)

%.h:
	touch $*.tmp
	$(CXX) $*.tmp -DCINTERFACE -D_REFIID_DEFINED= -D_REFGUID_DEFINED= -D_HRESULT_DEFINED= \
   -EP -FI $@ $(FLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(WARNINGS) > $@
	rm $*.tmp

SHELL:=$(SHELL) -o pipefail


ifeq ($(GENDEPS),0)
   DEPFLAGS :=
   MAKEDEPS :=
endif

%.$(OBJ_EXT): %.cpp
	$(CXX) -c $(CXX_OUT)$@ $< $(FLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(WARNINGS) $(DEPFLAGS)
	@$(MAKEDEPS)

%.$(OBJ_EXT): %.c
	$(CC) -c $(CC_OUT)$@ $< $(FLAGS) $(CFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(WARNINGS) $(DEPFLAGS)
	@$(MAKEDEPS)

%.res: %.rc
	$(RC) $<
	mv $*.res $@

$(TARGET)$(EXE_EXT): $(OBJ) .$(TARGET).last
	@touch .$(TARGET).last
	$(LD) $(OBJ) $(LDFLAGS) $(LIBS) $(LD_OUT)$@


%.depend: ;
%.last: ;
.FORCE:

clean:
	rm -f $(OBJ) $(TARGET)$(EXE_EXT)
	rm -f $(TARGET)
	rm -f .$(TARGET).last
	rm -f $(OBJ:.obj=.depend)

.PHONY: clean all
.PRECIOUS: %.depend %.last

-include $(patsubst %.obj,%.depend,$(filter %.obj,$(OBJ)))