1 # Makefile rules for release 1.0 of the omega system
2 # DON'T EDIT -- put any locally required changes in Makefile.config.
3 # See INSTALL for more details.
5 include $(BASEDIR)/Makefile.config
8 # Provide reasonable defaults for all the things you can specify in
16 STD_INCL_PATH= -I$(BASEDIR)/basic/include -I../include
19 STD_CFLAGS=-DOMIT_QUANTIFY_CALLS
21 TMP_REQ_INCL_PATH= $(REQUIRED:%=-I$(BASEDIR)/%/include)
22 REQ_INCL_PATH= $(TMP_REQ_INCL_PATH:%/omega/include=%/omega_lib/include)
23 TMP_REQ_LIB_PATH= $(REQUIRED:%=-L$(BASEDIR)/%/obj)
24 REQ_LIB_PATH= $(TMP_REQ_LIB_PATH:%/omega/obj=%/omega_lib/obj)
25 REQ_LIBS= $(REQUIRED:%=-l%)
27 INCL_PATH=$(STD_INCL_PATH) $(REQ_INCL_PATH) $(TARGET_INCL_PATH) $(EXTRA_INCL_PATH) $(X11_INCL_PATH) $(OS_INCL_PATH)
29 LIB_PATH=$(STD_LIB_PATH) $(REQ_LIB_PATH) $(TARGET_LIB_PATH) $(EXTRA_LIB_PATH) $(X11_LIB_PATH) $(OS_LIB_PATH)
30 # $(X11_LIBS) is not included here; if the application needs it, it should
31 # add it to TARGET_LIBS
32 LIBS=$(REQ_LIBS) $(STD_LIBS) $(TARGET_LIBS) $(OS_LIBS) $(EXTRA_LIBS)
34 CFLAGS=$(STD_CFLAGS) $(OPTIMIZATION_CFLAGS) $(COMPILER_CFLAGS) $(OS_CFLAGS) $(TARGET_CFLAGS) $(INCL_PATH)
35 LDFLAGS=$(STD_LDFLAGS) $(OPTIMIZATION_CFLAGS) $(TARGET_LDFLAGS) $(LIB_PATH) $(LIBS)
37 ALLDIRS=omega_lib omega_calc petit uniform code_gen basic
38 #ALLDIRS=omega_lib omega_calc petit code_gen basic
40 # Executable target; can have only one per directory
41 .executable: required_libs $(OBJS)
42 $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(TARGET)
46 # Library target; can have only one per directory
53 @for libname in $(REQUIRED) ; do\
54 libdir=`echo $$libname | sed 's/omega/omega_lib/g'` ; \
55 if test -d $(BASEDIR)/$$libdir ; \
57 cd $(BASEDIR)/$$libdir/obj; $(SUBMAKE) lib$$libname.a ; \
59 echo "ERROR: ${TARGET} requires omega/$$libdir: not found!"; \
65 cp /dev/null Makefile.deps
66 $(MAKEDEPEND) $(INCL_PATH) -fMakefile.deps $(SRCS) > /dev/null 2>1
68 depend_library: depend_self
70 depend_executable: depend_self
71 @for libname in $(REQUIRED) ; \
73 libdir=`echo $$libname | sed 's/omega/omega_lib/g'` ; \
74 if test -d $(BASEDIR)/$$libdir/obj ; \
76 echo "Makedepend for $$libdir:" ; \
77 cd $(BASEDIR)/$$libdir/obj; $(SUBMAKE) depend ; \
79 echo "WARNING: ${TARGET} requires omega/$$libdir: not found!";\
86 for dirname in $(ALLDIRS) ; \
88 if test -d $$dirname/obj ; \
90 echo "Makedepend in $$dirname:" ; \
92 $(SUBMAKE) depend_self ; \
95 if test $$dirname != "basic" ; then \
96 echo "$(BASEDIR)/$$dirname/obj not found, continuing." ; \
103 for dirname in $(ALLDIRS) ; \
105 if test -d $$dirname/obj ; \
107 echo "Clean in $$dirname:" ; \
112 if test $$dirname != "basic" ; then \
113 echo "$(BASEDIR)/$$dirname/obj not found, continuing." ; \
120 for dirname in $(ALLDIRS) ; \
122 if test -d $$dirname/obj ; \
124 echo "Clean in $$dirname:" ; \
126 $(SUBMAKE) veryclean ; \
129 if test $$dirname != "basic" ; then \
130 echo "$(BASEDIR)/$$dirname/obj not found, continuing." ; \
137 -$(RM) -f *.o *.o.li *.typ *.val petit[yl].[ch] hpp[yl].[ch] .tables .executable .library TAGS < /dev/null 2> /dev/null
139 veryclean_self: clean
140 -$(RM) -f *.a $(TARGET)
142 install_all: install_basic
144 for dirname in $(ALLDIRS) ; do \
145 if test -d $$dirname/obj ; \
147 echo "Installing in $$dirname:" ; \
149 $(SUBMAKE) install ; \
152 if test $$dirname != "basic" ; then \
153 echo "Warning: $$dirname not found, not installed." ;\
158 install_basic: include_exists
159 @echo "Installing in basic:"
160 cd $(BASEDIR)/basic/include; \
161 tar cf - basic | (cd $(INCL_DESTDIR); tar xf -)
164 install_library: lib_exists
165 $(CP) -p $(TARGET) $(LIB_DESTDIR)
167 install_includes: include_exists
169 tar cf - $(LIB) | (cd $(INCL_DESTDIR); tar xf -)
171 install_executable: bin_exists
172 $(CP) $(TARGET) $(BIN_DESTDIR)
175 include_exists: always
176 @if test ! -d $(INCL_DESTDIR) ; then \
177 mkdir $(INCL_DESTDIR); \
179 @if test ! -w $(INCL_DESTDIR) ; then \
180 echo "ERROR: $(INCL_DESTDIR) is not writable."; \
185 @if test ! -d $(LIB_DESTDIR) ; then \
186 mkdir $(LIB_DESTDIR); \
188 @if test ! -w $(LIB_DESTDIR) ; then \
189 echo "ERROR: $(LIB_DESTDIR) is not writable."; \
194 @if test ! -d $(BIN_DESTDIR) ; then \
195 mkdir $(BIN_DESTDIR) ;\
197 @if test ! -w $(BIN_DESTDIR) ; then \
198 echo "ERROR: $(BIN_DESTDIR) is not writable."; \
202 # Implicit rules: make C files in ../src/ directory
205 $(CC) $(CFLAGS) -c $<
208 $(CC) $(CFLAGS) -c $<
211 #Special rule for .c files in basic directory, ConstString and Link
212 %.o: $(BASEDIR)/basic/src/%.c
213 $(CC) $(CFLAGS) -c $<
215 y.tab.c: ../src/parser.y
216 ${RUMINANT} -v -d ../src/parser.y
220 lex.yy.c: ../src/parser.l y.tab.h
221 $(LEX) -i ../src/parser.l
224 ${CC} ${CFLAGS} -w -c ../src/PT.c
229 # The target "check_order" verifies that it's possible to get an ordering
230 # of routines in the library that will work with the single-pass UNIX linker.
231 # This is time consuming, and only necessary if you've extended the library in
234 # "gegrep" is GNU egrep
236 check_order : ubiquitous.names
237 bin/lorder ${OC_OBJ} | tsort > /dev/null
238 @echo " " ; echo " NOTE: this takes about 11 minutes of CPU time on our SPARC-10" ; echo " "
239 bin/lorder -x ubiquitous.names ${PRES_OBJ} ${REL_OBJ} ${FANCY_OBJ} | tsort > /dev/null
241 ubiquitous.names : lib_hack.o
242 nm lib_hack.o | gegrep -v '^........ d' | cut -c14- > ubiquitous.names
247 ln -s ../src/*.[chly] .
249 -include Makefile.deps