-
Notifications
You must be signed in to change notification settings - Fork 7
/
makefile.emx
127 lines (89 loc) · 2.03 KB
/
makefile.emx
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
# Constantin Knizhnik
# Moscow Software Center
# Pascal to C/C++ compiler.
#
.SUFFIXES: .cxx .c .h .o .a .exe
default : all
#
# Install path
#
INSTALL_LIB_DIR =
INSTALL_BIN_DIR =
#
# Target.
#
BINS = ptoc.exe cganal.exe
LIBS = ptoc.a Xbgi.a
#
# Chose compiler You prefer.
#
CC = gcc -Zmt
CCFLAGS = -O2 -Wall -c
DEFINES =
INCLUDES = -I.
YACC = bison -d -p zz
LEX = flex -i -F -8
#
# Chose linker You prefer.
#
LD = $(CC)
LDFLAGS = -Zcrtdll
AR = ar
ARFLAGS = -ru
#
# File lists.
#
INCS = main.h token.h token.dpp nmtbl.h bring.h tpexpr.h trnod.h util.h
SRCS = trnod.cxx nmtbl.cxx bring.cxx tpexpr.cxx util.cxx main.cxx parser.cxx lex.cxx token.cxx dprintf.cxx
LIB_SRCS = set.c paslib.c io.c
OBJS = $(SRCS:.cxx=.o)
LIB_OBJS = $(LIB_SRCS:.c=.o)
#
# Default way in which source files should be compiled.
#
.cxx.o :
$(CC) $(CCFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
.c.o :
$(CC) $(CCFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
#
# Custom targets.
#
$(OBJS) : $(INCS)
parser.cxx parser.h : parser.y
$(YACC) parser.y
mv parser.tab.c parser.cxx
mv parser.tab.h parser.h
lex.cxx : lex.l
$(LEX) lex.l
mv lex.yy.c lex.cxx
lex.o: lex.cxx token.h token.dpp
set.o: set.h ptoc.h
array.o: array.h ptoc.h
paslib.o: paslib.h ptoc.h
io.o: io.h ptoc.h
analyse.o: analyse.cxx main.h
ptoc.a: $(LIB_OBJS)
rm -f $@
$(AR) $(ARFLAGS) $@ $(LIB_OBJS)
ar s $@
cganal.exe : analyse.o
$(LD) $(LDFLAGS) -o $@ analyse.o
ptoc.exe : $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS)
Xbgi.a:
(cd Xbgi && $(MAKE) -f makefile.emx)
all : $(BINS) $(LIBS)
examples: $(BINS) $(LIBS)
(cd examples && $(MAKE) -f makefile.emx)
clean:
rm -f $(BINS) *.a a.out *.exe *.pdb *.lib *.tgz *.zip *.o lex.yy.c \
parser.tab.* WinBGI/*.pdb yy.log core y.output parser.output *.exe *~
(cd examples && make -f makefile.emx clean)
(cd Xbgi && make -f makefile.emx clean)
tgz: clean
(cd .. && tar cvzf ptoc.tgz ptoc)
copytgz: tgz
mcopy -o ../ptoc.tgz a:
install: $(BINS) $(LIBS)
cp $(BINS) $(INSTALL_BIN_DIR)
cp $(LIBS) $(INSTALL_LIB_DIR)