openpkg/openpkg.mk

Fri, 07 Sep 2012 19:08:07 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:08:07 +0200
changeset 667
9dacbd1d1aa2
permissions
-rw-r--r--

Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.

michael@428 1
michael@428 2 CC = cc
michael@428 3 CFLAGS =
michael@428 4 LDFLAGS =
michael@428 5 LIBS =
michael@428 6
michael@428 7 OPENPKG_PREFIX = /openpkg
michael@428 8 OPENPKG_SUSR = root
michael@428 9 OPENPKG_MUSR = openpkg
michael@428 10
michael@428 11 OPENPKG_DOT_C = openpkg.c
michael@428 12
michael@428 13 openpkg: $(OPENPKG_DOT_C)
michael@428 14 @os_name=`(uname -s) 2>/dev/null` || os_name='Unknown'; \
michael@428 15 os_name=`echo "$${os_name}" |\
michael@428 16 sed -e 's;[^a-zA-Z0-9];;g' |\
michael@428 17 tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`; \
michael@428 18 echo "++ compiling \"openpkg\" executable"; \
michael@428 19 echo " OPENPKG_PLATFORM_$${os_name}"; \
michael@428 20 echo " OPENPKG_PREFIX=\"$(OPENPKG_PREFIX)\""; \
michael@428 21 echo " OPENPKG_SUSR=\"$(OPENPKG_SUSR)\""; \
michael@428 22 echo " OPENPKG_MUSR=\"$(OPENPKG_MUSR)\""; \
michael@428 23 $(CC) $(CFLAGS) \
michael@428 24 -DOPENPKG_PLATFORM_$${os_name} \
michael@428 25 -DOPENPKG_PREFIX=\"$(OPENPKG_PREFIX)\" \
michael@428 26 -DOPENPKG_SUSR=\"$(OPENPKG_SUSR)\" \
michael@428 27 -DOPENPKG_MUSR=\"$(OPENPKG_MUSR)\" \
michael@428 28 -o openpkg $(OPENPKG_DOT_C) \
michael@428 29 $(LDFLAGS) $(LIBS)
michael@428 30
michael@428 31 clean:
michael@428 32 -rm -f openpkg
michael@428 33

mercurial