1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2025-09-15 19:03:49 +00:00

Add true makefile + lists

This commit is contained in:
2016-12-10 02:28:10 +01:00
parent 30e9c36b2d
commit 77491c8e61
9 changed files with 256 additions and 48 deletions

View File

@@ -1,21 +1,57 @@
CXX = gcc
TARGET = Exe
SOURCEFILE = CellElemFunc
CFLAGS = -Wall -Werror -ansi -pedantic -fpic -I. -g
# Makefile compiling the whole project
# Don't forget before the first compilation to run that command:
# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./Libs
#Generating the executable
$(TARGET): $(SOURCEFILE).o
@echo "Generating the executable" $@
$(CXX) $(CFLAGS) $(SOURCEFILE).o -o $@
CC=gcc
CFLAGS=-Wall -Werror -pedantic -fpic -g
$(SOURCEFILE).o:
@echo "Generating objectfiles" $@
$(CXX) $(CFLAGS) -c $(SOURCEFILE).c -o $@
#Cleaning the executable
LIBSDIR=-L/usr/lib -L./Libs
INCLUDEDIR=-I/usr/include -I. -I./LibCell -I./LibList
#Exe test variables
TARGET=main.exe
SOURCE=main
SOURCECFILE=$(SOURCE:=.c)
SOURCEOFILE=$(SOURCE:=.o)
#Library variables
DEPENDENCE=libCellElement.so
DEPENDENCENAME=CellElement
DEPENDENCELIST=libList.so
DEPENDENCENAMELIST=List
all: $(TARGET)
#Generating the main.exe
$(TARGET): $(SOURCEOFILE) $(DEPENDENCELIST) lib
@echo "\n Generating the " $(TARGET) " binary"
$(CC) $(SOURCEOFILE) $(LIBSDIR) -l$(DEPENDENCENAME) -l$(DEPENDENCENAMELIST) -o $(TARGET)
#Generating the library binary
lib:
@echo "\n Generating the automaton library binary"
mkdir -p Libs
$(MAKE) -C LibCell
$(DEPENDENCELIST):
@echo "\n Generating the list library binary"
$(MAKE) -C LibList
#Generating object files
.c.o:
@echo "\n Generating " $@ " from " $<
$(CC) $(CFLAGS) $(INCLUDEDIR) -c -o $@ $<
#Cleaning
clean:
@echo "Cleaning temporary files"
rm -rf *.o *- *.so $(TARGET)
@echo "\n Cleaning"
rm -rf *.o ./Libs/*.so *.exe
$(MAKE) -C LibCell clean
$(MAKE) -C LibList clean