|
1 # |
|
2 ## CDDL HEADER START |
|
3 # |
|
4 # The contents of this file are subject to the terms of the |
|
5 # Common Development and Distribution License (the "License"). |
|
6 # You may not use this file except in compliance with the License. |
|
7 # |
|
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 # or http://www.opensolaris.org/os/licensing. |
|
10 # See the License for the specific language governing permissions |
|
11 # and limitations under the License. |
|
12 # |
|
13 # When distributing Covered Code, include this CDDL HEADER in each |
|
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 # If applicable, add the following below this CDDL HEADER, with the |
|
16 # fields enclosed by brackets "[]" replaced with your own identifying |
|
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 # |
|
19 # CDDL HEADER END |
|
20 # |
|
21 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
|
22 # |
|
23 |
|
24 COMPILER=gcc |
|
25 |
|
26 include ../../../make-rules/shared-macros.mk |
|
27 |
|
28 include $(WS_MAKE_RULES)/prep.mk |
|
29 include $(WS_MAKE_RULES)/configure.mk |
|
30 include $(WS_MAKE_RULES)/ips.mk |
|
31 |
|
32 COMPONENT_DIR := $(shell pwd)/.. |
|
33 |
|
34 COMPONENT_PRE_BUILD_ACTION = \ |
|
35 ( $(MKDIR) build/$(MACH) ; \ |
|
36 $(MKDIR) build/$(MACH64) ) |
|
37 |
|
38 OBJECTS = cxa_finalize-32.o cxa_finalize-64.o \ |
|
39 cxa_finalize_pic-32.o cxa_finalize_pic-64.o |
|
40 |
|
41 include $(WS_MAKE_RULES)/prep.mk |
|
42 |
|
43 RELEASE_LIST=Debug+Asserts+Checks Debug+Asserts Debug Release+Debug Release Unoptimized |
|
44 |
|
45 CFLAGS = -g -O2 -std=c99 -Wall -Wextra -Wcast-align |
|
46 ARCH = $(shell uname -p) |
|
47 |
|
48 ifeq ($(ARCH),sparc) |
|
49 CFLAGS += -mtune=ultrasparc -mcpu=ultrasparc -mvis |
|
50 endif |
|
51 |
|
52 ifeq ($(ARCH),i386) |
|
53 CFLAGS += -mtune=opteron -march=opteron |
|
54 endif |
|
55 |
|
56 all:: $(OBJECTS) |
|
57 |
|
58 cxa_finalize-32.o: cxa_finalize.c |
|
59 $(CC) -m32 $(CFLAGS) -c $< -o $@ |
|
60 |
|
61 cxa_finalize_pic-32.o: cxa_finalize.c |
|
62 $(CC) -m32 $(CFLAGS) -fPIC -c $< -o $@ |
|
63 |
|
64 cxa_finalize-64.o: cxa_finalize.c |
|
65 $(CC) -m64 $(CFLAGS) -c $< -o $@ |
|
66 |
|
67 cxa_finalize_pic-64.o: cxa_finalize.c |
|
68 $(CC) -m64 $(CFLAGS) -fPIC -c $< -o $@ |
|
69 |
|
70 cxa_atexit-32.o: cxa_atexit.c |
|
71 $(CC) -m32 $(CFLAGS) -c $< -o $@ |
|
72 |
|
73 cxa_atexit-64.o: cxa_atexit.c |
|
74 $(CC) -m64 $(CFLAGS) -c $< -o $@ |
|
75 |
|
76 clean:: |
|
77 rm -f $(OBJECTS) |
|
78 |
|
79 check:: build |
|
80 $(MKDIR) build/$(MACH) |
|
81 $(MKDIR) build/$(MACH64) |
|
82 |
|
83 build: all |
|
84 |
|
85 install: build |
|
86 $(MKDIR) $(PROTOUSRLIBDIR)/clang |
|
87 $(MKDIR) $(PROTOUSRLIBDIR)/clang/$(MACH64) |
|
88 $(CP) cxa_finalize-32.o \ |
|
89 $(PROTOUSRLIBDIR)/clang/cxa_finalize.o |
|
90 $(CP) cxa_finalize_pic-32.o \ |
|
91 $(PROTOUSRLIBDIR)/clang/cxa_finalize_pic.o |
|
92 $(CP) cxa_finalize-64.o \ |
|
93 $(PROTOUSRLIBDIR)/clang/$(MACH64)/cxa_finalize.o |
|
94 $(CP) cxa_finalize_pic-64.o \ |
|
95 $(PROTOUSRLIBDIR)/clang/$(MACH64)/cxa_finalize_pic.o |
|
96 list='$(RELEASE_LIST)'; for f in $$list; do \ |
|
97 if test -d $(BUILD_DIR_32)/$$f/lib ; then \ |
|
98 echo "Installing cxa_finalize in $(BUILD_DIR_32)/$$f/lib..." ; \ |
|
99 $(MKDIR) $(BUILD_DIR_32)/$$f/lib/$(MACH64) ; \ |
|
100 $(CP) cxa_finalize-32.o \ |
|
101 $(BUILD_DIR_32)/$$f/lib/cxa_finalize.o ; \ |
|
102 $(CP) cxa_finalize_pic-32.o \ |
|
103 $(BUILD_DIR_32)/$$f/lib/cxa_finalize_pic.o ; \ |
|
104 $(CP) cxa_finalize-64.o \ |
|
105 $(BUILD_DIR_32)/$$f/lib/$(MACH64)/cxa_finalize.o ; \ |
|
106 $(CP) cxa_finalize_pic-64.o \ |
|
107 $(BUILD_DIR_32)/$$f/lib/$(MACH64)/cxa_finalize_pic.o ; \ |
|
108 fi ; \ |
|
109 if test -d $(BUILD_DIR_64)/$$f/lib ; then \ |
|
110 echo "Installing cxa_finalize in $(BUILD_DIR_64)/$$f/lib..." ; \ |
|
111 $(MKDIR) $(BUILD_DIR_64)/$$f/lib/$(MACH64) ; \ |
|
112 $(CP) cxa_finalize-32.o \ |
|
113 $(BUILD_DIR_64)/$$f/lib/cxa_finalize.o ; \ |
|
114 $(CP) cxa_finalize_pic-32.o \ |
|
115 $(BUILD_DIR_64)/$$f/lib/cxa_finalize_pic.o ; \ |
|
116 $(CP) cxa_finalize-64.o \ |
|
117 $(BUILD_DIR_64)/$$f/lib/$(MACH64)/cxa_finalize.o ; \ |
|
118 $(CP) cxa_finalize_pic-64.o \ |
|
119 $(BUILD_DIR_64)/$$f/lib/$(MACH64)/cxa_finalize_pic.o ; \ |
|
120 fi ; \ |
|
121 done |
|
122 |
|
123 test: |
|
124 echo "No tests." |
|
125 |
|
126 system-test: |
|
127 echo "No system tests." |
|
128 |