1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-11-23 03:03:19 +00:00
LO27/Makefile

58 lines
1.2 KiB
Makefile
Raw Normal View History

2016-12-10 01:28:10 +00:00
# Makefile compiling the whole project
# Don't forget before the first compilation to run that command:
# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./Libs
2016-11-09 10:06:10 +00:00
2016-12-10 01:28:10 +00:00
CC=gcc
2016-12-10 04:04:13 +00:00
CFLAGS=-Wall -Werror -pedantic -fpic -g
2016-11-09 10:06:10 +00:00
2016-12-10 01:28:10 +00:00
LIBSDIR=-L/usr/lib -L./Libs
INCLUDEDIR=-I/usr/include -I. -I./LibCell -I./LibList
2016-11-09 10:06:10 +00:00
2016-12-10 01:28:10 +00:00
#Exe test variables
TARGET=main.exe
SOURCE=main
2016-11-09 10:06:10 +00:00
2016-12-10 01:28:10 +00:00
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
2016-11-09 10:06:10 +00:00
lib:
2016-12-10 01:28:10 +00:00
@echo "\n Generating the automaton library binary"
2016-12-10 04:04:13 +00:00
mkdir -p Libs
2016-12-10 01:28:10 +00:00
$(MAKE) -C LibCell
$(DEPENDENCELIST):
@echo "\n Generating the list library binary"
$(MAKE) -C LibList
2016-11-09 10:06:10 +00:00
2016-12-10 01:28:10 +00:00
#Generating object files
.c.o:
@echo "\n Generating " $@ " from " $<
$(CC) $(CFLAGS) $(INCLUDEDIR) -c -o $@ $<
#Cleaning
clean:
@echo "\n Cleaning"
rm -rf *.o ./Libs/*.so *.exe
2016-12-10 04:04:13 +00:00
$(MAKE) -C LibCell clean
2016-12-10 01:28:10 +00:00
$(MAKE) -C LibList clean
2016-11-09 10:06:10 +00:00