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
,libcchash-
$(VERSION
).
$(SUFFIX
)
36 COMP
=@echo CC
$@
;$(CC
)
37 LINKER
=@echo LINK
$@
;$(CC
) $(LDOPT
)
41 OUTPUT_LIB
= $(NAME
).
$(VERSION
).
$(SUFFIX
)
44 ifeq ($(UNAME
),Darwin
)
45 SINGLE_MODULE
=-Wl
,-single_module
47 export MACOSX_DEPLOYMENT_TARGET
=10.5
49 export MACOSX_DEPLOYMENT_TARGET
=10.4
56 CFLAGS
+=-D__C99FEATURES__
63 OPTIMIZATIONS
=-O2
-funroll-loops
-finline-functions
$(INLINE_OPTS
)
66 ifeq ($(CPU
), powerpc
)
67 OPTIMIZATIONS
+=-falign-loops
=16
70 CFLAGS
+= -fPIC
$(CPPFLAGS
)
72 DEPS
= hashtable.h hashtable_itr.h hashtable_utility.h
73 OBJS
= hashtable.o hashtable_itr.o hashtable_utility.o
77 tester
: hashtable.o tester.o hashtable_itr.o
78 $(CC
) $(CFLAGS
) -o tester hashtable.o hashtable_itr.o tester.o
81 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
84 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
89 $(CC
) -MM
$(CPPFLAGS
) $< > $@.
$$$$; \
90 sed
's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.
$$$$ > $@
; \
93 library
: $(OUTPUT_LIB
) $(OUTPUT_A
)
95 $(OUTPUT_LIB
): $(DEPS
) $(OBJS
)
96 $(LINKER
) -o
$(OUTPUT_LIB
) $(OBJS
) $(SONAME
) $(LIBS
)
98 $(OUTPUT_A
): $(DEPS
) $(OBJS
)
99 $(AR
) cru
$(OUTPUT_A
) $(OBJS
)
100 $(RANLIB
) $(OUTPUT_A
)
105 rm -f
*.o
*.lo
*.la
*.so
*.dylib
*.a tester
109 ifneq ($(MAKECMDGOALS
),clean)
110 -include $(SOURCES
:%.c
=.
%.d
)