I am currently working on an assignment that requires me to build a Makefile that
- creates an include directory
- copies math330.h file into the include directory
- create a lib directory
- compile the .c files in trig and exp as object files
- make a library
- install the library to the lib directory
- compile the cli program against the include and library directory
So I have most of the coding down for this, but I keep getting errors for when i try to put the .o's for the trig functions in the include folder. The error is
trig/cos330.c:1:10: fatal error: 'math330.h' file not found
This is just the last part i need help with! Can someone give me hints about what I can do? Thanks!
all:
mkdir -p ./include
mkdir -p ./lib
cp math330.h ./include
gcc -l ./include/ -c trig/*.c
gcc -l ./include/ -c exp/*.c
mv *.o ./lib/
ar r libmath.a lib/*
mv libmath.a lib/
gcc -l ./include/ cli/cli.c -L ./lib -lmath -lm
clean:
rm -rf include
rm -rf lib
rm a.out