]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## PTX-specific setup | |
374ca955 | 3 | ## Copyright (c) 1999-2004, International Business Machines Corporation and |
b75a7d8f | 4 | ## others. All Rights Reserved. |
b75a7d8f A |
5 | |
6 | ## Flags for position independent code | |
7 | SHAREDLIBCFLAGS = -KPIC | |
8 | SHAREDLIBCXXFLAGS = -KPIC | |
9 | SHAREDLIBCPPFLAGS = -DPIC | |
10 | ||
11 | ## Commands to generate dependency files | |
12 | GEN_DEPS.c= $(CC) -Kthread -DPTX -c $(DEFS) $(CPPFLAGS) | |
13 | GEN_DEPS.cc= $(CXX) -M -DPTX $(DEFS) $(CPPFLAGS) | |
14 | ||
15 | ## Commands to compile | |
16 | COMPILE.c= $(CC) -Kthread -DPTX $(DEFS) $(CPPFLAGS) $(CFLAGS) -c | |
17 | COMPILE.cc= $(CXX) -Kthread -DPTX $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c | |
18 | ||
19 | ## Commands to link | |
20 | #LINK.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) | |
21 | LINK.c= $(CXX) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -lm -lgen | |
22 | LINK.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -lm -lgen | |
23 | ||
24 | ## Commands to make a shared library | |
25 | SHLIB.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DPTX -G | |
26 | SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DPTX -G | |
27 | ||
28 | ## Compiler switch to embed a runtime search path | |
29 | LD_RPATH= -R | |
30 | LD_RPATH_PRE= | |
31 | ||
32 | ## Versioned target for a shared library. | |
33 | FINAL_SO_TARGET = $(SO_TARGET) | |
34 | MIDDLE_SO_TARGET = | |
35 | ||
36 | ## Shared object suffix | |
37 | SO= so | |
38 | ## Non-shared intermediate object suffix | |
39 | STATIC_O = ao | |
40 | ||
41 | ## Compilation rules | |
42 | %.$(STATIC_O): $(srcdir)/%.c | |
43 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
44 | %.o: $(srcdir)/%.c | |
45 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
46 | ||
47 | %.$(STATIC_O): $(srcdir)/%.cpp | |
48 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
49 | %.o: $(srcdir)/%.cpp | |
50 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
51 | ||
52 | ## Dependency rules | |
53 | %.d : $(srcdir)/%.c | |
54 | @echo "generating dependency information for $<" | |
55 | @$(SHELL) -ec '$(GEN_DEPS.c) $< \ | |
56 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
57 | [ -s $@ ] || rm -f $@' | |
58 | ||
59 | %.d : $(srcdir)/%.cpp | |
60 | @echo "generating dependency information for $<" | |
61 | @$(SHELL) -ec '$(GEN_DEPS.cc) -o $@ $< \ | |
62 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
63 | [ -s $@ ] || rm -f $@' | |
64 | ||
65 | ## End Ptx-specific setup |