-
Notifications
You must be signed in to change notification settings - Fork 8
/
makefile.mingw-text
93 lines (67 loc) · 2.9 KB
/
makefile.mingw-text
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
# Makefile for brandy under Windows x86 / x64 with MinGW using Cygwin as the
# toolchain
# Find MinGW gcc
compiler=$(shell which i686-w64-mingw32-gcc.exe 2>/dev/null)
MINGWPATH=/usr/i686-w64-mingw32/sys-root/mingw
ifeq ($(compiler),)
compiler=$(shell which x86_64-w64-mingw32-gcc.exe 2>/dev/null)
MINGWPATH=/usr/x86_64-w64-mingw32/sys-root/mingw
ifeq ($(compiler),)
$(error Unable to find MinGW gcc compiler)
endif
endif
CC = $(compiler)
LD = $(compiler)
STRIP = strip
ADDFLAGS = ${BRANDY_BUILD_FLAGS}
include build/git.mk
#CFLAGS = -g -DDEBUG -DCYGWINBUILD -DNO_SDL -DDEFAULT_IGNORE -D__USE_MINGW_ANSI_STDIO=1 -Wall $(GITFLAGS) $(ADDFLAGS)
#CFLAGS = -g -DCYGWINBUILD -DDEFAULT_IGNORE -D__USE_MINGW_ANSI_STDIO=1 -Wall $(GITFLAGS) $(ADDFLAGS)
CFLAGS = -O3 -DCYGWINBUILD -DNO_SDL -DDEFAULT_IGNORE -D__USE_MINGW_ANSI_STDIO=1 -Wall $(GITFLAGS) $(ADDFLAGS)
LDFLAGS =
LIBS = -lm -lws2_32 -mconsole $(MINGWPATH)/lib/libdxguid.a $(MINGWPATH)/lib/libwinmm.a $(MINGWPATH)/lib/libpthread.a $(MINGWPATH)/lib/libdl.a $(MINGWPATH)/lib/libpsapi.a
SRCDIR = src
OBJ = $(SRCDIR)/variables.o $(SRCDIR)/tokens.o \
$(SRCDIR)/strings.o $(SRCDIR)/statement.o $(SRCDIR)/stack.o \
$(SRCDIR)/miscprocs.o $(SRCDIR)/mainstate.o $(SRCDIR)/lvalue.o \
$(SRCDIR)/keyboard.o $(SRCDIR)/iostate.o $(SRCDIR)/heap.o \
$(SRCDIR)/functions.o $(SRCDIR)/fileio.o $(SRCDIR)/evaluate.o \
$(SRCDIR)/errors.o $(SRCDIR)/mos.o $(SRCDIR)/editor.o \
$(SRCDIR)/convert.o $(SRCDIR)/commands.o $(SRCDIR)/brandy.o \
$(SRCDIR)/assign.o $(SRCDIR)/net.o $(SRCDIR)/mos_sys.o
TEXTONLYOBJ = $(SRCDIR)/textonly.o
SIMPLETEXTOBJ = $(SRCDIR)/simpletext.o
SRC = $(SRCDIR)/variables.c $(SRCDIR)/tokens.c \
$(SRCDIR)/strings.c $(SRCDIR)/statement.c $(SRCDIR)/stack.c \
$(SRCDIR)/miscprocs.c $(SRCDIR)/mainstate.c $(SRCDIR)/lvalue.c \
$(SRCDIR)/keyboard.c $(SRCDIR)/iostate.c $(SRCDIR)/heap.c \
$(SRCDIR)/functions.c $(SRCDIR)/fileio.c $(SRCDIR)/evaluate.c \
$(SRCDIR)/errors.c $(SRCDIR)/mos.c $(SRCDIR)/editor.c \
$(SRCDIR)/convert.c $(SRCDIR)/commands.c $(SRCDIR)/brandy.c \
$(SRCDIR)/assign.c $(SRCDIR)/net.c $(SRCDIR)/mos_sys.c
TEXTONLYSRC = $(SRCDIR)/textonly.c
SIMPLETEXTSRC = $(SRCDIR)/simpletext.c
all: tbrandy sbrandy
tbrandy: $(OBJ) $(TEXTONLYOBJ)
$(LD) $(LDFLAGS) -o tbrandy $(OBJ) $(TEXTONLYOBJ) $(LIBS)
sbrandy: $(OBJ) $(SIMPLETEXTOBJ)
$(LD) $(LDFLAGS) -o sbrandy $(OBJ) $(SIMPLETEXTOBJ) $(LIBS)
include build/depends.mk
.c.o:
$(CC) $(CFLAGS) $< -c -o $@
trecompile:
$(CC) $(CFLAGS) $(SRC) $(TEXTONLYSRC) $(LIBS) -o tbrandy
srecompile:
$(CC) $(CFLAGS) $(SRC) $(SIMPLETEXTSRC) $(LIBS) -o sbrandy
tnodebug:
$(CC) $(CFLAGS2) $(SRC) $(TEXTONLYSRC) $(LIBS) -o tbrandy
$(STRIP) tbrandy
snodebug:
$(CC) $(CFLAGS2) $(SRC) $(SIMPLETEXTSRC) $(LIBS) -o sbrandy
$(STRIP) sbrandy
tcheck:
$(CC) $(CFLAGS) -Wall -O2 $(SRC) $(TEXTONLYSRC) $(LIBS) -o tbrandy
scheck:
$(CC) $(CFLAGS) -Wall -O2 $(SRC) $(SIMPLETEXTSRC) $(LIBS) -o sbrandy
clean:
rm -f $(SRCDIR)/*.o tbrandy sbrandy