mirror of
https://gitlab.com/klmp200/LO27.git
synced 2024-11-29 15:54:14 +00:00
36 lines
1.0 KiB
Makefile
36 lines
1.0 KiB
Makefile
CXX = gcc
|
|
TARGET = exe
|
|
SOURCEFILE = main
|
|
CFLAGS = -Wall -Werror -I. -ansi -pedantic -fpic -g
|
|
LIST_LIBRARY = matrix/libMatrix
|
|
|
|
#Generating the executable
|
|
$(TARGET): $(SOURCEFILE).o
|
|
@echo "Generating the executable"
|
|
$(CXX) $(CFLAGS) $(SOURCEFILE).o -o $(TARGET)
|
|
|
|
$(SOURCEFILE).o: $(LIST_LIBRARY).so
|
|
@echo "Generating $(SOURCEFILE).o"
|
|
$(CXX) $(CFLAGS) -Lmatrix -lmatrix -c $(SOURCEFILE).c -o $@ -LlibMatrix -llibMatrix.so
|
|
|
|
$(LIST_LIBRARY).so:clean
|
|
@echo "Generating libMatrix.so" $@
|
|
#gcc matrix.c -I. -Wall -Werror -fpic -shared -o $(LIST_LIBRARY).so
|
|
$(CXX) -Wall -Werror -ansi -pedantic -I. matrix.c -o $(LIST_LIBRARY).so -shared -fpic
|
|
|
|
|
|
#Cleaning the executable
|
|
clean:
|
|
@echo "Cleaning temporary files and libMatrix.so"
|
|
rm -rf *.o *- *.so $(TARGET)
|
|
rm -rf $(LIST_LIBRARY).so
|
|
#Generating library
|
|
lib:
|
|
@echo "Generating libMatrix.so"
|
|
$(CXX) -Wall -Werror -ansi -pedantic -I. matrix.c -o $(LIST_LIBRARY).so -shared -fpic
|
|
|
|
release:
|
|
@echo "Generating a release version of the program"
|
|
make CFLAGS= '-Wall -Werror -I. -ansi -pedantic -fpic'
|
|
|