§ 13.10 - build_plugin

#!/bin/sh
# Set NAM= to the name of YOUR plugin. Be creative, and DON'T use spaces!
# -----------------------------------------------------------------------
NAM=plugin_demo

# Assemble name of final target
# -----------------------------
TGT=ak_${NAM}.so.1
echo "building \"${TGT}\"" 

# Get rid of the old executables, if they exist:
# ----------------------------------------------
echo "cleaning"
rm -f "${NAM}.o"
rm -f "${TGT}"

# This is included in the compile to automatically set the compile date
# ---------------------------------------------------------------------
echo "generating compile date"
date "+ p->year = %Y;   p->month = X%m; p->day = %e;" > ak_pu_date.txt

# this is the c compile stage.
# position independent (-fPIC), posix threadable (-pthreads), for 386 architecture (-arch i386)
# all warnings (-Wall) be picky (-pedantic) use c99 as the standard (-std=c99)
# ---------------------------------------------------------------------------------------------
echo "compiling"
gcc -c -fPIC -pthreads -pedantic -Wall -arch i386 -std=c99 "${NAM}.c" -o "${NAM}.o"

# This is the link into executable library stage
# Make an OSX linkable lib (-dynamiclib), pass options to linker (-Wl), for 386 architecture (-arch i386)
# -------------------------------------------------------------------------------------------------------
echo "linking"
gcc -dynamiclib -Wl,"${NAM}.o"  -arch i386 -o "${TGT}"
echo "done!"

Keyboard Navigation
, Previous Page . Next Page t TOC i Index o Operators g Glossary

Valid HTML 4.01 Loose
 

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
aa_macro uses python 2.7
Please consider supporting my dTank (β) development efforts via a small PayPal donation.