Skip to content

Commit 4884aad

Browse files
committed
Makefile update
1 parent aa297f4 commit 4884aad

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
**asysc** is an analog system compiler based on the lightweight Computer Algebra System **lightcas**.
55

6-
Using a Computer Algebra System (CAS), you can write your own components by using algebraic descriptions.
7-
8-
Description example for a resistor:
6+
With ASysC, you can write your own components by using algebraic descriptions. For instance, consider the resistor declaration:
97

108
NAME.CR(@1,@2,R) := {
119
NAME.U=ACROSS(@1,@2);

examples/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
SHELL = /bin/bash
44
CIRCUITS_SRC = $(shell find -name "*.cir")
55
CIRCUITS_PY = $(CIRCUITS_SRC:.cir=.py)
6-
SIMULATION_PY = $(shell find -name simulation.py)
6+
EXAMPLE_DIRS = $(dir $(CIRCUITS_SRC))
77
BIN_DIR = ../lightcas/bin
88

99
all : $(CIRCUITS_PY)
1010

11-
%.py: %.cir circuit_base.py
12-
cp -f circuit_base.py $(@D)
11+
%.py: %.cir circuit_base.py
1312
-if [[ "$^" == *"ac/"* ]]; \
1413
then \
1514
ANALYSIS_MODE="ac"; \
@@ -25,12 +24,13 @@ endif
2524
-[ -f debug.log ] && mv debug.log $(@D)
2625

2726
clean:
28-
-rm -f $(CIRCUITS_PY)
27+
-rm -f $(CIRCUITS_PY) $(addsuffix "circuit_base.py", $(EXAMPLE_DIRS))
2928

3029
run: all
31-
for SIM_FILE in $(SIMULATION_PY); do \
32-
pushd $$(dirname $$SIM_FILE) > /dev/null; \
33-
echo Executing $$(dirname $$SIM_FILE)/simulation.py; \
30+
for EXAMPLE_DIR in $(EXAMPLE_DIRS); do \
31+
cp -fu circuit_base.py $$EXAMPLE_DIR; \
32+
pushd $$EXAMPLE_DIR > /dev/null; \
33+
echo Executing $$EXAMPLE_DIR/simulation.py; \
3434
python3 simulation.py; \
3535
popd > /dev/null; \
3636
done

examples/transient/oscillator/simulation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def add_plot( axs, element ):
2929

3030
my_circuit = circuit()
3131
my_circuit.NOT1_Uin.init( 5 )
32+
3233
my_circuit.simulate_t(0.01, 512)
3334

3435
fig, axs = plt.subplots(1, 1, layout='constrained')

0 commit comments

Comments
 (0)