#$Id: Make1,v 26.135 2009/12/02 09:26:53 al Exp $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <aldavis@gnu.org>
#
# 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.
#------------------------------------------------------------------------
TARGET = gnucap
#------------------------------------------------------------------------
DELETED = \
s__.cc s__aux.cc s__map.cc 
#------------------------------------------------------------------------
# These source files can be omitted, and supplied as plugins.
# device models defined in high level .model files
MODELS = \
d_mos1.model d_mos2.model d_mos3.model \
d_mos4.model d_mos5.model d_mos6.model d_mos7.model d_mos8.model \
d_mos123.model d_mos_base.model d_mos.model \
d_bjt.model d_diode.model

# device models hand coded in C++
D_SRCS = \
d_admit.cc d_cap.cc d_cccs.cc d_ccvs.cc d_coil.cc \
d_cs.cc d_poly_g.cc d_poly_cap.cc d_res.cc d_switch.cc \
d_trln.cc d_vcg.cc d_vcr.cc d_vcvs.cc d_vs.cc

# behavioral modeling functions
BM_SRCS = \
bm_complex.cc bm_cond.cc bm_exp.cc bm_fit.cc bm_generator.cc \
bm_model.cc bm_poly.cc bm_posy.cc bm_pulse.cc bm_pwl.cc bm_sffm.cc \
bm_sin.cc bm_tanh.cc bmm_table.cc bmm_semi.cc

# utility commands, usually one file per command
# some have multiple commands in a file
C_SRCS = \
c_clear.cc c_comand.cc c_delete.cc c_exp.cc c_list.cc \
c_measure.cc c_modify.cc c_param.cc c_prbcmd.cc c_status.cc \
c_sweep.cc c_sim.cc c_system.cc

# simulation commands, usually multiple files for one command
S_SRCS = \
s_ac.cc s_dc.cc s_fo.cc \
s_tr.cc s_tr_set.cc s_tr_swp.cc

# netlist languages
LANG_SRCS = \
lang_spice.cc lang_spectre.cc lang_verilog.cc

# parameter functions
FUNC_SRCS = \
func_core.cc measure_eval.cc \
measure_max.cc measure_min.cc measure_slewrate.cc measure_cross.cc \
measure_integral.cc measure_average.cc measure_rms.cc measure_at.cc
#------------------------------------------------------------------------
RAW_SRCS = \
$(D_SRCS) \
$(BM_SRCS) \
$(C_SRCS) \
$(S_SRCS) \
$(LANG_SRCS) \
$(FUNC_SRCS) \
m_expression_dump.cc m_expression_in.cc m_expression_reduce.cc \
m_base_in.cc m_base_math.cc m_fft.cc  m_spline.cc \
ap_construct.cc ap_convert.cc ap_error.cc ap_get.cc ap_match.cc ap_skip.cc \
l_ftos.cc l_pmatch.cc l_timer.cc l_trim.cc l_wmatch.cc \
io.cc io_contr.cc io_error.cc io_findf.cc io_out.cc io_xopen.cc \
u_function.cc u_lang.cc u_nodemap.cc u_opt1.cc u_opt2.cc u_parameter.cc \
u_prblst.cc u_probe.cc u_sim_data.cc u_xprobe.cc \
s__init.cc s__out.cc s__solve.cc \
d_subckt.cc d_logic.cc d_logicmod.cc \
e_base.cc e_card.cc e_node.cc e_model.cc e_compon.cc \
e_elemnt.cc e_ccsrc.cc e_storag.cc e_cardlist.cc \
bm_value.cc bm.cc \
c__cmd.cc c_attach.cc c_file.cc c_genrat.cc \
findbr.cc plot.cc main.cc globals.cc
#------------------------------------------------------------------------
RAW_HDRS = \
md.h ap.h mode.h constant.h declare.h patchlev.h \
l_compar.h l_dispatcher.h l_denoise.h \
l_lib.h l_stlextra.h l_timer.h \
m_cpoly.h m_divdiff.h m_interp.h m_matrix.h m_spline.h m_wave.h \
m_base.h m_expression.h m_phase.h \
io_.h io_error.h io_trace.h \
u_cardst.h u_function.h u_lang.h u_limit.h u_nodemap.h u_opt.h u_parameter.h \
u_prblst.h u_probe.h u_sim_data.h u_sdp.h u_status.h u_time_pair.h u_xprobe.h \
s__.h s_tr.h \
e_base.h e_card.h e_node.h e_aux.h e_model.h e_compon.h e_subckt.h \
e_elemnt.h e_ccsrc.h e_storag.h e_cardlist.h \
d_coment.h d_dot.h d_logic.h d_subckt.h \
bm.h \
c_comand.h globals.h
#------------------------------------------------------------------------
RAW_OTHER = \
configure.old Make1 test_readline.cc spice-wrapper.cc \
Make3 Makefile.template \
Make2.g++ Make2.Debug Make2.mingw32 \
Makefile.am
#------------------------------------------------------------------------
RAW = $(RAW_HDRS) $(RAW_SRCS) $(MODELS) $(RAW_OTHER)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
IMPORTED_SRCS =
IMPORTED_HDRS =
IMPORTED_OTHER = Makefile.in
IMPORTED = $(IMPORTED_SRCS) $(IMPORTED_HDRS) $(IMPORTED_OTHER)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
GENERATED_SRCS = ${MODELS:.model=.cc}
GENERATED_HDRS = ${MODELS:.model=.h}
GENERATED_OTHER = Make.aux
GENERATED = $(GENERATED_HDRS) $(GENERATED_SRCS) $(GENERATED_OTHER)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
GENERATED_DIST = Make.depend
IMPORTED_DIST = $(IMPORTED)
DISTFILES = $(RAW) $(GENERATED_DIST) $(IMPORTED_DIST)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
SRCS = $(IMPORTED_SRCS) $(GENERATED_SRCS) $(RAW_SRCS)
HDRS = $(RAW_HDRS) $(GENERATED_HDRS) $(IMPORTED_HDRS)
OBJS = ${SRCS:.cc=.o}
TARGET_DEPENDS = $(OBJS) $(RAW) $(MODELS)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
MOSTLYCLEANFILES = $(OBJS) $(GENERATED)
CLEANFILES = $(MOSTLYCLEANFILES)
DISTCLEANFILES = $(CLEANFILES)
MAINTAINERCLEANFILES = $(DISTCLEANFILES)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
all: $(TARGET)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
%.h : %.model gnucap-modelgen
	./gnucap-modelgen -h $<
#------------------------------------------------------------------------
%.cc : %.model gnucap-modelgen
	./gnucap-modelgen -cc $<
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
