#
#   Version 1.2
#
#   Copyright 2016-2018 Lee Djavaherian
#
#   This file is part of SimtheoDecoder.
#
#   SimtheoDecoder is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Lesser Lesser Lesser General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   SimtheoDecoder is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Lesser Lesser Lesser General Public License for more details.
#
#   You should have received a copy of the GNU Lesser Lesser Lesser General Public License
#   along with SimtheoDecoder.  If not, see <http://www.gnu.org/licenses/>.
###################################################################################

#This creates a static simtheo library for the ATtiny 1634
#and creates both static and dynamic simtheo libraries
#for the Raspberry Pi 1, 2, and 3 (ARMv6h, ARMv7h, and ARMv8).
#It needs to use the /tmp folder for temporary processing.

libsimtheo:

	avr-gcc -c -Wall -std=c11 -mmcu=attiny1634 -Os libsimtheo.c -o /tmp/libsimtheo-ATtiny1634.o
	avr-ar rcs libsimtheo-ATtiny1634.a /tmp/libsimtheo-ATtiny1634.o
	rm /tmp/libsimtheo-ATtiny1634.o
	
	gcc -c -Wall -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -funsafe-math-optimizations -mfloat-abi=hard -std=c11 libsimtheo.c -o /tmp/libsimtheo-ARMv8.o
	ar rcs libsimtheo-ARMv8.a /tmp/libsimtheo-ARMv8.o
	rm /tmp/libsimtheo-ARMv8.o
	
	gcc -fPIC -shared -Wall -Wl,-soname,libsimtheo.so.1 -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -funsafe-math-optimizations -mfloat-abi=hard -std=c11 libsimtheo.c -o libsimtheo-ARMv8.so.1.2
	
	gcc -c -Wall -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -std=c11 libsimtheo.c -o /tmp/libsimtheo-ARMv7h.o
	ar rcs libsimtheo-ARMv7h.a /tmp/libsimtheo-ARMv7h.o
	rm /tmp/libsimtheo-ARMv7h.o
	
	gcc -fPIC -shared -Wall -Wl,-soname,libsimtheo.so.1 -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -std=c11 libsimtheo.c -o libsimtheo-ARMv7h.so.1.2
	
	gcc -c -Wall -march=armv6 -mfpu=vfp -mfloat-abi=hard -std=c11 libsimtheo.c -o /tmp/libsimtheo-ARMv6h.o
	ar rcs libsimtheo-ARMv6h.a /tmp/libsimtheo-ARMv6h.o
	rm /tmp/libsimtheo-ARMv6h.o
	
	gcc -fPIC -shared -Wall -Wl,-soname,libsimtheo.so.1 -march=armv6 -mfpu=vfp -mfloat-abi=hard -std=c11 libsimtheo.c -o libsimtheo-ARMv6h.so.1.2

