How to make Makefile?

This commit is contained in:
2024-02-04 20:19:52 +05:30
parent ebafca3461
commit dee48d5d1b
8 changed files with 257 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
TARGET: exemath
exemath: main.o libcalc.a
gcc main.o -o exemath -L . libcalc.a -lm
libcalc.a: trig_math/trig_math.o common_math/common_math.o complex_math/complex_math.o
ar rs libcalc.a common_math/common_math.o complex_math/complex_math.o trig_math/trig_math.o
common_math.o: common_math/common_math.c
gcc -c -I common_math common_math/common_math.c -o common_math/common_math.o
complex_math.o: complex_math/complex_math.c
gcc -c -I complex_math complex_math/complex_math.c -o complex_math/complex_math.o
trig_math.o: trig_math/trig_math.c
gcc -c -I trig_math trig_math/trig_math.c -o trig_math/trig_math.o
main.o: main.c
gcc -c -I common_math -I complex_math -I trig_math main.c -o main.o
clean:
rm common_math/common_math.o
rm complex_math/complex_math.o
rm trig_math/trig_math.o
rm main.o
rm libcalc.a
rm exemath