1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2025-02-17 00:37:09 +00:00
LO27/Makefile

51 lines
1.1 KiB
Makefile
Raw Normal View History

2016-12-10 02:28:10 +01: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 11:06:10 +01:00
2016-12-10 02:28:10 +01:00
CC=gcc
2016-12-28 21:39:42 +01:00
CFLAGS=-Wall -Werror -pedantic -fpic -g -std=c89 -Wextra
2016-11-09 11:06:10 +01:00
2016-12-27 17:36:08 +01:00
EXTLIBS=`sdl2-config --cflags --libs`
2016-11-09 11:06:10 +01:00
2016-12-10 02:28:10 +01:00
LIBSDIR=-L/usr/lib -L./Libs
2016-12-28 18:49:26 +01:00
INCLUDEDIR=-I/usr/include -I. -I./LibMatrix -I./LibGui
2016-11-09 11:06:10 +01:00
2016-12-10 02:28:10 +01:00
#Exe test variables
2016-12-28 18:49:26 +01:00
TARGET=Matrix.exe
SOURCE=matrixmain
2016-11-09 11:06:10 +01:00
2016-12-10 02:28:10 +01:00
SOURCECFILE=$(SOURCE:=.c)
SOURCEOFILE=$(SOURCE:=.o)
2016-12-28 18:49:26 +01:00
DEPENDENCELIST=libMatrix.so libGui.so
DEPENDENCENAMEONE=Matrix
DEPENDENCENAMETWO=Gui
2016-12-10 02:28:10 +01:00
all: $(TARGET)
#Generating the main.exe
2016-12-28 18:49:26 +01:00
$(TARGET): $(SOURCEOFILE) lib
2016-12-10 02:28:10 +01:00
@echo "\n Generating the " $(TARGET) " binary"
2016-12-10 23:21:17 +01:00
mkdir -p build
$(CC) $(SOURCEOFILE) $(LIBSDIR) $(EXTLIBS) -l$(DEPENDENCENAMEONE) -l$(DEPENDENCENAMETWO) -o ./build/$(TARGET)
2016-12-10 02:28:10 +01:00
#Generating the library binary
2016-11-09 11:06:10 +01:00
lib:
2016-12-28 18:49:26 +01:00
@echo "\n Generating the gui library binary"
2016-12-11 01:53:18 +01:00
mkdir -p Libs
2016-12-28 18:49:26 +01:00
$(MAKE) -C LibMatrix
$(MAKE) -C LibGui
2016-11-09 11:06:10 +01:00
2016-12-10 02:28:10 +01:00
#Generating object files
.c.o:
@echo "\n Generating " $@ " from " $<
$(CC) $(CFLAGS) $(INCLUDEDIR) -c -o $@ $<
#Cleaning
clean:
@echo "\n Cleaning"
2016-12-28 18:49:26 +01:00
rm -rf *.o ./Libs/*.so ./build/$(TARGET)
$(MAKE) -C LibMatrix clean
$(MAKE) -C LibGui clean