-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (57 loc) · 1.56 KB
/
Makefile
File metadata and controls
69 lines (57 loc) · 1.56 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
##
TARGET = WeatherInfo
SRCS = WeatherInfo.d weather_hacks.d debuglog.d sdl2tk.d
#OBJS =
#RES = resource.res
####
## http://dlang.org/dmd-windows.html
DMD = dmd
DFLAGS = -O -inline -boundscheck=off -wi
DEBUG_DFLAGS = -g -wi -version=useDebugLog
DMDLIBS = lib/sdl2.lib
DEBUG_DMDLIBS = lib/sdl2_debug.lib
DLDFLAGS = -L/exet:nt/su:windows:4.0
#http://msdn.microsoft.com/ja-jp/library/fcc1zstk.aspx
#DLDFLAGS = -L/SUBSYSTEM:CONSOLE:5.01
#DLDFLAGS = -L/SUBSYSTEM:WINDOWS:5.01
####
## http://www.digitalmars.com/ctg/sc.html
DMC = dmc
DMCFLAGS = -HP99 -g -o+none -D_WIN32_WINNT=0x0400 -I$(SETUPHDIR) $(CPPFLAGS)
DMCLIB = lib
DMCLIBFLAGS = lib -p64 -c -n
#DMCLIBFLAGS = lib -p512 -c -n
####
## http://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html
CC = gcc
CXX = g++
CFLAGS = -Wall -O2
CLDFLAGS =
CINCLUDES = -I/usr/local/include
CLIBS = -L/usr/local/lib -lm
####---------------
# $@ : Target name
# $^ : depend Target name
# $< : Target Top Name
# $* : Target name with out suffix name
# $(MACRO:STING1=STRING2) : Replace STRING1 to STRING2
#
all : $(TARGET).exe
debug : $(TARGET)_debug.exe
$(TARGET).exe : $(SRCS)
$(DMD) $(DFLAGS) $(SRCS) $(RES) $(DMDLIBS) $(DLDFLAGS) -of$(TARGET).exe
$(TARGET)_debug.exe : $(SRCS)
$(DMD) $(DEBUG_DFLAGS) $(SRCS) $(RES) $(DEBUG_DMDLIBS) $(DLDFLAGS) -of$(TARGET)_debug.exe
test :
$(TARGET).exe
clean :
rm -f $(TARGET).exe $(TARGET)_debug.exe *.obj
# -rm -f $(TARGET) $(OBJS)
.c.obj :
$(CC) $(CFLAGS) $(INCLUDES) -c $<
#.d.obj :
# $(DMD) $(DFLAGS) -c $<
#
# Depend of header file
# obj : header
# foo.obj : foo.h