equal
deleted
inserted
replaced
|
1 # |
|
2 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
|
3 # |
|
4 # U.S. Government Rights - Commercial software. Government users are subject |
|
5 # to the Sun Microsystems, Inc. standard license agreement and applicable |
|
6 # provisions of the FAR and its supplements. |
|
7 # |
|
8 # Use is subject to license terms. |
|
9 # |
|
10 # This distribution may include materials developed by third parties. Sun, |
|
11 # Sun Microsystems, the Sun logo and Solaris are trademarks or registered |
|
12 # trademarks of Sun Microsystems, Inc. in the U.S. and other countries. |
|
13 # |
|
14 # |
|
15 |
|
16 # |
|
17 # |
|
18 # Makefile to generate demo_module_3.so |
|
19 # |
|
20 # usage: |
|
21 # setenv CC /usr/bin/cc (or correct path) |
|
22 # "make" : generate library for 64bit |
|
23 # "make ARCH=32" : generate library for 32bit |
|
24 # "make clean" : remove *.o , *.so |
|
25 # |
|
26 |
|
27 ARCH=64 |
|
28 LDFLAGS_64=-g -m64 -I. |
|
29 LDFLAGS_32=-g -I. |
|
30 LDFLAGS=$(LDFLAGS_$(ARCH)) |
|
31 |
|
32 LDLIBS= |
|
33 |
|
34 PROG= demo_module_3.so |
|
35 SRCS= demo_module_3.c |
|
36 OBJS = $(SRCS:.c=.o) |
|
37 |
|
38 all:$(PROG) |
|
39 $(PROG): $(OBJS) |
|
40 $(CC) $(LDFLAGS) $(LDLIBS) -G -o $@ $(OBJS) |
|
41 .c.o: |
|
42 @if test "$(CC)" = "" ; then \ |
|
43 echo "Environment variable CC must be set with compiler path" ; \ |
|
44 exit 1 ; \ |
|
45 fi |
|
46 $(CC) $(LDFLAGS) -g -o $@ -c $< |
|
47 |
|
48 clean: |
|
49 rm -f demo_module_3.o demo_module_3.so |