2016-12-27 19:12:41 +00:00
|
|
|
CC=gcc
|
2016-12-28 20:39:42 +00:00
|
|
|
CFLAGS=-Wall -Werror -pedantic -fpic -g -std=c89 -Wextra
|
2016-12-27 19:12:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
LIBSDIR=-L/usr/lib -L../Libs
|
2016-12-28 17:49:26 +00:00
|
|
|
INCLUDEDIR=-I/usr/include -I. -I../LibMatrix
|
2016-12-27 19:12:41 +00:00
|
|
|
|
|
|
|
#Library variables
|
|
|
|
LIBTARGET=libGui.so
|
|
|
|
LIBSOURCE=pixel
|
|
|
|
LIBSOURCECFILE=$(LIBSOURCE:=.c)
|
|
|
|
LIBSOURCEOFILE=$(LIBSOURCE:=.o)
|
|
|
|
|
2016-12-28 17:49:26 +00:00
|
|
|
DEPENDENCELIST=libMatrix.so
|
|
|
|
DEPENDENCENAMELIST=Matrix
|
2016-12-27 19:12:41 +00:00
|
|
|
|
|
|
|
EXTLIBS=`sdl2-config --cflags --libs`
|
|
|
|
|
|
|
|
#Generating the library binary
|
|
|
|
$(LIBTARGET): $(LIBSOURCEOFILE)
|
|
|
|
@echo "\n Generating the library binary"
|
|
|
|
$(CC) $(CFLAGS) $(LIBSDIR) $(EXTLIBS) -l$(DEPENDENCENAMELIST) -shared $(LIBSOURCEOFILE) -o ../Libs/$(LIBTARGET)
|
|
|
|
|
|
|
|
#Generating object files
|
|
|
|
.c.o:
|
|
|
|
@echo "\n Generating " $@ " from " $<
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDEDIR) -c -o $@ $<
|
|
|
|
|
|
|
|
#Cleaning
|
|
|
|
clean:
|
|
|
|
@echo "\n Cleaning"
|
|
|
|
rm -rf *.o *.exe *.so
|
|
|
|
|
|
|
|
|