Browse Source

add configure script

master
milang 10 months ago
parent
commit
351baafae1
No known key found for this signature in database GPG Key ID: D287C9D6C33D9035
2 changed files with 89 additions and 1 deletions
  1. +3
    -1
      Makefile
  2. +86
    -0
      configure

+ 3
- 1
Makefile View File

@@ -1,3 +1,5 @@
include Makefile.cfg

target=fx9860g

CONFIG.TARGET = fx
@@ -12,7 +14,7 @@ machine := -m3 -mb
# Compiler flags, assembler flags, dependency generation, archiving
cflags := $(machine) -ffreestanding -nostdlib -Wall -Wextra -std=c11 -Os \
-fstrict-volatile-bitfields -I include $(CONFIG.MACROS) \
$(CONFIG.CFLAGS)
$(CONFIG.CFLAGS) $(PROFILING)
sflags := $(CONFIG.MACROS)
dflags = -MMD -MT $@ -MF $(@:.o=.d) -MP
arflags :=


+ 86
- 0
configure View File

@@ -0,0 +1,86 @@
#! /bin/bash

#
# Basic configuration
#



output="Makefile.cfg"

#
# Help screen
#

help()
{
cat << EOF
Configuration script for the fxengine library.
Usage: $0 [options...]

You should build out-of-tree by creating a build directory and configuring from
there.


Build option:

--enable-profiling

By default, profiling is disabled, tht means you will not have access to fps. :(

This option enables fps count, but you need to have libprof (by Lephenixnoir) installed


EOF
exit 0
}

if [[ "$@" == "--help" ]]; then
help
exit 1
fi

#
# Parsing arguments
#

add_cflags=

fail=false
for arg; do case "$arg" in
-h | -? | --help)
help;;


--enable-profiling)
add_cflags=-DUSE_LIBPROF;;

*)
echo "error: unrecognized argument '$arg'";
fail=true;;
esac; done

#
# Checking mandatory arguments
#

if $fail; then
echo "Oops ! Maybe a wrong option..."
exit 1
fi


#
# Output config
#

output_config()
{
echo -n "PROFILING ="
echo -n " $(echo $add_cflags)"
echo ""
}

output_config > $output

echo "Configuration saved in $output, ready to make!"

Loading…
Cancel
Save