-
Notifications
You must be signed in to change notification settings - Fork 4
/
main_in.mk
170 lines (128 loc) · 3.9 KB
/
main_in.mk
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
161
162
163
164
165
166
167
168
169
170
#
# S51 main.mk
#
# (c) Drotos Daniel, Talker Bt. 1997,99
#
STARTYEAR = 1997
SHELL = /bin/sh
CXX = @CXX@
#CPP = @CPP@
CXXCPP = @CXXCPP@
RANLIB = @RANLIB@
INSTALL = @INSTALL@
MAKEDEP = @MAKEDEP@
AR = @AR@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SIMDIR = sim.src
CMDDIR = cmd.src
GUIDIR = gui.src
DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
# FIXME: -Imcs51 must be removed!!!
CPPFLAGS = @CPPFLAGS@ -I$(top_builddir) -I$(srcdir) \
-I$(top_srcdir)/$(SIMDIR) \
-I$(top_srcdir)/$(CMDDIR) -I$(top_srcdir)/$(GUIDIR)
CFLAGS = @CFLAGS@ -I$(top_builddir) @WALL_FLAG@
CXXFLAGS = @CXXFLAGS@ -I$(top_builddir) @WALL_FLAG@
WINSOCK_AVAIL = @WINSOCK_AVAIL@
LDFLAGS = @LDFLAGS@
EXEEXT = @EXEEXT@
LIB_LIST = sim ucsimutil guiucsim cmd ucsimutil sim
UCSIM_LIBS = $(patsubst %,-l%,$(LIB_LIST)) @LIBS@
UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST))
RELAY_LIBS = $(patsubst %,-l%,ucsimutil) @LIBS@
RELAY_LIB_FILES = $(patsubst %,lib%.a,ucsimutil)
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
datadir = @datadir@
datarootdir = @datarootdir@
includedir = @includedir@
mandir = @mandir@
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
infodir = @infodir@
srcdir = @srcdir@
VPATH = @srcdir@
OBJECTS = pobj.o globals.o utils.o error.o app.o option.o chars.o fio.o
ifeq ($(WINSOCK_AVAIL), 1)
OBJECTS += fwio.o
else
OBJECTS += fuio.o
endif
SOURCES = $(patsubst %.o,%.cc,$(OBJECTS))
UCSIM_OBJECTS = ucsim.o
UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
RELAY_OBJECTS = relay.o
RELAY_SOURCES = $(patsubst %.o,%.cc,$(RELAY_OBJECTS))
ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES) $(RELAY_SSOURCES)
enable_ucsim = @enable_ucsim@
# Compiling entire program or any subproject
# ------------------------------------------
all: checkconf libs
libs: libucsimutil.a
main_app: checkconf ucsim_app relay_app
# Compiling and installing everything and runing test
# ---------------------------------------------------
install: all installdirs
# Deleting all the installed files
# --------------------------------
uninstall:
rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/savr$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/serialview$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/portmon$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/sstm8$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/sst7$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/sp1516$(EXEEXT)
# Performing self-test
# --------------------
check:
test:
# Performing installation test
# ----------------------------
installcheck:
# Creating installation directories
# ---------------------------------
installdirs:
# Creating dependencies
# ---------------------
dep: main.dep
main.dep: $(ALL_SOURCES) *.h $(srcdir)/*.h
$(MAKEDEP) $(CPPFLAGS) $(filter %.cc,$^) >main.dep
-include main.dep
include $(srcdir)/clean.mk
#parser.cc: parser.y
#plex.cc: plex.l
# My rules
# --------
libucsimutil.a: $(OBJECTS)
$(AR) -rc $@ $(OBJECTS)
$(RANLIB) $@
ifeq ($(enable_ucsim),yes)
ucsim_app: libs ucsim$(EXEEXT)
else
ucsim_app:
endif
ftest_app: libs ftest$(EXEEXT)
relay_app: libs relay$(EXEEXT)
ucsim$(EXEEXT): $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
echo $(UCSIM_LIB_FILES)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $< -L$(top_builddir) $(UCSIM_LIBS) -o $@
ftest$(EXEEXT): ftest.o libucsimutil.a
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L$(top_builddir) -lucsimutil @LIBS@
relay$(EXEEXT): $(RELAY_OBJECTS) $(RELAY_LIB_FILES)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $< -L$(top_builddir) $(RELAY_LIBS) -o $@
ptt: ptt.o
$(CXX) $(CXXFLAGS) -o $@ $< -lpthread
.cc.o:
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
# Remaking configuration
# ----------------------
checkconf:
@if [ -f devel ]; then\
$(top_srcdir)/mkecho $(top_builddir) "MAIN.MK checkconf";\
$(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
fi
# End of main_in.mk/main.mk