1 -include ..
/..
/config.mk
3 # Respect the environment
10 MARCH
=$(shell uname
-m
)
11 OSVER
=$(shell uname
-r
)
16 CFLAGS
= $(WARNINGS
) $(DEBUG
)
19 ifeq ($(UNAME
),Darwin
)
22 SONAME
=-current_version
$(VERSION
) -compatibility_version
$(VERSION
)
26 ifneq ($(UNAME
),SunOS
)
27 SONAME
=-Wl
,-soname
,libmquark-
$(VERSION
).
$(SUFFIX
)
36 COMP
=@echo CC
$@
;$(CC
)
37 LINKER
=@echo LINK
$@
;$(CC
) $(LDOPT
)
43 OUTPUT_LIB
=$(NAME
).
$(VERSION
).
$(SUFFIX
)
46 ifeq ($(UNAME
),Darwin
)
47 SINGLE_MODULE
=-Wl
,-single_module
49 export MACOSX_DEPLOYMENT_TARGET
=10.5
51 export MACOSX_DEPLOYMENT_TARGET
=10.4
58 CFLAGS
+=-D__C99FEATURES__
65 OPTIMIZATIONS
=-O2
-funroll-loops
-finline-functions
$(INLINE_OPTS
)
68 ifeq ($(CPU
), powerpc
)
69 OPTIMIZATIONS
+=-falign-loops
=16
72 CPPFLAGS
+= -I..
/libcchash
-I..
/libmpa
-std
=c99
73 CFLAGS
+= -fPIC
$(CPPFLAGS
)
78 LIBS
=-L..
/libcchash
-L..
/libmpa
-lcchash
-lptr_array
-lm
80 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
83 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
88 $(CC
) -MM
$(CPPFLAGS
) $< > $@.
$$$$; \
89 sed
's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.
$$$$ > $@
; \
92 library
: $(OUTPUT_LIB
) $(OUTPUT_A
)
94 $(OUTPUT_LIB
): $(DEPS
) $(OBJS
)
95 $(LINKER
) -o
$(OUTPUT_LIB
) $(OBJS
) $(SONAME
) $(LIBS
)
97 $(OUTPUT_A
): $(DEPS
) $(OBJS
)
98 $(AR
) cru
$(OUTPUT_A
) $(OBJS
)
104 rm -f
*.o
*.lo
*.la
*.so
*.dylib
*.a tester
109 tester
: tester.o
$(OUTPUT_A
)
110 $(CC
) -o tester
$(OBJS
) tester.o
$(LIBS
) $(OUTPUT_A
)
114 ifneq ($(MAKECMDGOALS
),clean)
115 -include $(SOURCES
:%.c
=.
%.d
)