-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeBase
More file actions
100 lines (86 loc) · 3.89 KB
/
Copy pathMakeBase
File metadata and controls
100 lines (86 loc) · 3.89 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
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
# Copyright (C) 2024 Felix Salfelder
#
# This file is part of "Gnucap", the Gnu Circuit Analysis Package
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#------------------------------------------------------------------------
#perhaps synchronise with gnucap/include/MakeBase
all: $(TARGET) ${TARGET_LIB:%=%${TARGET_LIB_EXT}} ${TARGET_EXE:%=%${TARGET_EXE_EXT}}
MODELGEN = ../src/gnucap-mg-vams
all: ${TARGET}
install : $(INSTALL_FILES) $(INSTALL_FILES_1) $(INSTALL_FILES_2)
[ -z "$(INSTALL_DIR)" ] || mkdir -p $(DESTDIR)$(INSTALL_DIR) # Make3
[ -z "$(INSTALL_DIR_1)" ] || mkdir -p $(DESTDIR)$(INSTALL_DIR_1)
[ -z "$(INSTALL_DIR_2)" ] || mkdir -p $(DESTDIR)$(INSTALL_DIR_2)
[ -z "$(INSTALL_FILES)" ] || cp $(INSTALL_FILES) $(DESTDIR)$(INSTALL_DIR)
[ -z "$(INSTALL_FILES_1)" ] || cp $(INSTALL_FILES_1) $(DESTDIR)$(INSTALL_DIR_1)
[ -z "$(INSTALL_FILES_2)" ] || cp $(INSTALL_FILES_2) $(DESTDIR)$(INSTALL_DIR_2)
# these seem to belong to Make2...
%.so: %.o
${CXX} -shared ${GNUCAP_CXXFLAGS} ${CXXFLAGS} $< -o $@ # Make3
%.o: %.cc
${CXX} -I. ${INCLUDE} ${CCFLAGS} ${MAKE_CPPFLAGS} $(GNUCAP_CPPFLAGS) $(CPPFLAGS) ${MAKE_CPPFLAGS} -fPIC ${MAKE_CXXFLAGS} ${GNUCAP_CXXFLAGS} ${CXXFLAGS} $< -o $@ -c # MakeBaseA
%.s: %.cc
${CXX} -S ${GNUCAP_CPPFLAGS} ${CPPFLAGS} ${MAKE_CPPFLAGS} -DNDEBUG -O2 -fPIC ${GNUCAP_CXXFLAGS} ${CXXFLAGS} $< -o $@ # MakeBaseB
depend Make.depend: # $(SRCS) ${GENERATED_SRCS} $(HDRS)
: > Make.depend
if [ -n "$(RAW_SRCS)" ]; then \
( cd ${srcdir}; $(CXX) -MM $(CXXFLAGS) -I../src -I${PWD} -isystem ${GNUCAP_INCLUDEDIR} ${CPPFLAGS} \
${MAKE_CPPFLAGS} ${RAW_SRCS} -DDEPEND ) \
>> Make.depend; \
fi
if [ -n "$(GENERATED_SRCS)" ]; then \
$(CXX) -MM $(CXXFLAGS) -isystem ${GNUCAP_INCLUDEDIR} ${CPPFLAGS} \
${MAKE_CPPFLAGS} $(GENERATED_SRCS) -DDEPEND \
>> Make.depend; \
fi
.PRECIOUS: Make.depend
#-----------------------------------------------------------------------------
clean:
rm -rf $(CLEANFILES)
rm -f *.o *.obj *~
mostlyclean: clean
rm -rf $(MOSTLYCLEANFILES)
distclean: clean
rm -rf $(DISTCLEANFILES)
# maintainer-clean:
# rm -rf $(MAINTAINERCLEANFILES)
# rm -f */*.o */*.obj */*.h */*.cc
# rm -f *~ \#*\#
#-----------------------------------------------------------------------------
# include/MakeConf.default says (let's try)
MAKE_EXE = $(CXX) $(CCFLAGS) $(MAKE_CXXFLAGS) $(CXXFLAGS) ${MAKE_CPPFLAGS} ${GNUCAP_CPPFLAGS} ${CPPFLAGS} $(OBJS) $(LIBS) $(LDFLAGS) -o $@ # mgvams/MakeBase
MAKE_LIB = $(CXX) $(CCFLAGS) $(MAKE_CXXFLAGS) ${GNUCAP_CXXFLAGS} $(CXXFLAGS) ${MAKE_CPPFLAGS} ${GNUCAP_CPPFLAGS} ${CPPFLAGS} $(OBJS) $(LIBS) $(LDFLAGS) -shared -o $@ # mgvams/MakeBase
# MAKE_EXE = $(CXX) $(CCFLAGS) $(OBJS) $(TARGET_LIBS) $(LDFLAGS) -o
# MAKE_LIB = $(CXX) $(CCFLAGS) $(OBJS) $(TARGET_LIBS) $(LDFLAGS) -shared -o
#
# supposedly "Make3" (?)
# work in progress...
#
# temporary workaround, see source
%.raw: %.h
sed -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
mg_out_root.o: ${EMBED_HEADERS}
$(TARGET_EXE)$(TARGET_EXE_EXT): $(TARGET_DEPENDS)
rm -f $@
$(MAKE_EXE) # -o $@
#------------------------------------------------------------------------
%.a: ${OBJS}
${CXX} ${OBJS} -shared -o $@
#------------------------------------------------------------------------
.PHONY: clean distclean install all uninstall depend
.SECONDARY: ${TARGET:.so=.cc}
.DELETE_ON_ERROR: