File: Makefile

package info (click to toggle)
safe-iop 0.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 172 kB
  • sloc: ansic: 1,578; makefile: 28
file content (42 lines) | stat: -rw-r--r-- 1,527 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# safe_iop - Makefile
#
# Author:: Will Drewry <redpig@dataspill.org>
# Copyright 2007,2008 redpig@dataspill.org
# Some portions copyright 2008 Google Inc.
#
# Unless required by applicable law or agreed to in writing, software
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied.
#

CC ?= gcc
VERSION = 0.3
TESTNAME = safe_iop_test
# For sparc64, _only_ use -O1 or -O0
LOCAL_CFLAGS = -Iinclude -fPIC
SOURCES = src/safe_iop.c

all: libsafe_iop.so.$(VERSION) libsafe_iop.a

# This may be built as a library or directly included in source.
# Unless support for safe_iopf is needed, header inclusion is enough.

$(TESTNAME): src/safe_iop.c include/safe_iop.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -DNDEBUG=1 -DSAFE_IOP_TEST=1 $(SOURCES) -o $@

askme: examples/askme.c include/safe_iop.h
	$(CC) $(CPPFLAGS) $(CFLAGS) examples/askme.c -o $@

libsafe_iop.so.$(VERSION): src/safe_iop.c include/safe_iop.h
	$(CC) -shared -Wl,-soname,libsafe_iop.so.0 $(LOCAL_CFLAGS) $(SOURCES) -o $@ $(CPPFLAGS) $(LDFLAGS)

dylib: src/safe_iop.c include/safe_iop.h
	$(CC) -dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,$(VERSION),-current_version,$(VERSION),-install_name,/usr/local/lib/libsafe_iop.$(VERSION).dylib $(CPPFLAGS) $(CFLAGS) $(SOURCES) -o libsafe_iop.$(VERSION).dylib

libsafe_iop.a: src/safe_iop.c include/safe_iop.h
	$(CC) -c $(CFLAGS) $(SOURCES) $(LOCAL_CFLAGS) $(CPPFLAGS) -o safe_iop.o
	ar rs $@ safe_iop.o

clean:
	rm -f *.a *.o *.so.*