-
Notifications
You must be signed in to change notification settings - Fork 4
/
automake.inc
162 lines (137 loc) · 3.98 KB
/
automake.inc
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
CONFIG
// make sure to use fixed output names for lib and dll
FOR EACH LIB,DLL
OUTPUT = lib%(NAME).la
ENDFOR
ALLDIRS = ./
AC_OUTPUT = ./Makefile
FOR EACH WORKSPACE
FOR REVERSE EACH USE
x = %(PATH)
WHILE "%(x)"!="./"
../../ALLDIRS += %(|x)
../../AC_OUTPUT += %(|x)Makefile
x = %(?x)
ENDWHILE
IF "%(../../ACTIVETARGET)"=="" && (%(TYPE)=="exe" || %(TYPE)=="con")
../../ACTIVETARGET = %(PATH)%(OUTPUT)
ENDIF
ENDFOR
ENDFOR
FILE %(¯)Makefile.cvs
PRINTNL default: all
PRINTNL all:
PRINTNL aclocal
PRINTNL libtoolize --force
PRINTNL autoheader
PRINTNL automake --add-missing --foreign
PRINTNL autoconf
FILE %(¯)configure.in
PRINTNL AC_INIT(root,1.0)
PRINTNL
PRINTNL AC_CONFIG_SRCDIR(configure.in)
PRINTNL AM_CONFIG_HEADER(%(@BUILDPATH)/config.h)
PRINTNL AC_CONFIG_AUX_DIR(%(@BUILDPATH))
PRINTNL
PRINTNL AM_INIT_AUTOMAKE
PRINTNL
PRINTNL AC_LANG_C
PRINTNL AC_PROG_CC
PRINTNL AM_PROG_LIBTOOL
PRINTNL
PRINTNL AC_OUTPUT(%(AC_OUTPUT))
PRINTNL
FOR EACH ALLDIRS
FILE %(¯NAME)Makefile.am
PRINTNL AUTOMAKE_OPTIONS = foreign
PRINTNL INCLUDES= $(all_includes)
FOR EACH ../ALLDIRS
IF "%(?NAME)"=="%(../NAME)"
../SUBDIRS += %(|@NAME)
ENDIF
ENDFOR
IF "%(SUBDIRS)"!=""
PRINTNL SUBDIRS = %(SUBDIRS)
ENDIF
FOR EACH ../LIB,../DLL,../EXE,../CON
IF "%(PATH)"=="%(../NAME)"
IF %(TYPE)==LIB || %(TYPE)==DLL
OUTPUT2 = %(<OUTPUT)_%(>OUTPUT)
OUTPUT2_LDADD = %(OUTPUT2)_LIBADD
../noinst_LTLIBRARIES += %(OUTPUT)
IF %(TYPE)==LIB
LDFLAGS = -static
ENDIF
IF %(TYPE)==DLL
LDFLAGS = -module
ENDIF
ELSE
IF "%(../ACTIVE)"==""
../ACTIVE = %(!PATH)%(OUTPUT)
ENDIF
OUTPUT2 = %(OUTPUT)
OUTPUT2_LDADD = %(OUTPUT2)_LDADD
../noinst_PROGRAMS += %(OUTPUT)
ENDIF
LDADD += %(<LIBS:%=-l%)
FOR EACH USE
../DEPENDENCIES += %(!PATH)%(OUTPUT)
IF (!%(NOLIB))
../LDADD += %(!PATH)%(OUTPUT)
ENDIF
ENDFOR
//PRINTNL %(OUTPUT2)_CPPFLAGS = $(AM_CPPFLAGS) %(DEFINE:%=-D "%") %(@INCLUDE:%=-I$(srcdir)/%) %(@SYSINCLUDE:%=-I$(srcdir)/%)
../AM_CPPFLAGS += %(DEFINE:%=-D "%") %(º@INCLUDE:%=-I%) %(ºº@INCLUDE:%=-I$(srcdir)/%) %(º@SYSINCLUDE:%=-I%) %(ºº@SYSINCLUDE:%=-I$(srcdir)/%)
IF %(TYPE)!=LIB
LDFLAGS += %(º@RPATH:%=-R %) %(ºº@RPATH:%=-R $(srcdir)/%) %(º@LIBINCLUDE:%=-L%) %(ºº@LIBINCLUDE:%=-L$(srcdir)/%)
ENDIF
PRINTNL
FOR EACH SOURCE
IF "%(>NAME)"=="c" || "%(>NAME)"=="cpp"
../SOURCES += %(!NAME)
ENDIF
IF (%(ASM)!="") && "%(>NAME)"=="asm"
../LDADD += %(<NAME).lo
../DEPENDENCIES += %(<NAME).lo
ENDIF
ENDFOR
FOR EACH HEADER
../../noinst_HEADERS += %(!NAME)
ENDFOR
IF "%(DEPENDENCIES)"!=""
PRINTNL %(OUTPUT2)_DEPENDENCIES = %(DEPENDENCIES)
ENDIF
IF %(LDFLAGS) != ""
PRINTNL %(OUTPUT2)_LDFLAGS = %(LDFLAGS)
ENDIF
IF "%(LDADD)"!=""
PRINTNL %(OUTPUT2_LDADD) = %(LDADD)
ENDIF
IF "%(SOURCES)"!=""
PRINTNL %(OUTPUT2)_SOURCES = %(SOURCES)
PRINTNL
ENDIF
IF (%(ASM)!="")
FOR EACH SOURCE
IF "%(>NAME)"=="asm"
PRINTNL %(<NAME).lo: %(!NAME)
PRINTNL $(LIBTOOL) --tag=CC --mode=compile %(ASM) %(ASMFLAGS) $(AM_CPPFLAGS) $< -o $@ -prefer-non-pic
PRINTNL
ENDIF
ENDFOR
ENDIF
ENDIF
ENDFOR
IF "%(noinst_HEADERS)"!=""
PRINTNL noinst_HEADERS = %(noinst_HEADERS)
ENDIF
IF "%(AM_CPPFLAGS)"!=""
PRINTNL AM_CPPFLAGS = %(AM_CPPFLAGS)
ENDIF
IF "%(noinst_LTLIBRARIES)"!=""
PRINTNL noinst_LTLIBRARIES = %(noinst_LTLIBRARIES)
ENDIF
IF "%(noinst_PROGRAMS)"!=""
PRINTNL noinst_PROGRAMS = %(noinst_PROGRAMS)
ENDIF
ENDFOR