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
,libbstrings-
$(VERSION
).
$(SUFFIX
)
32 LINKER
= $(CC
) $(LDOPT
)
36 COMP
=@echo CC
$@
;$(CC
)
37 LINKER
=@echo LINK
$@
;$(CC
) $(LDOPT
)
42 OUTPUT_LIB
=libbstring.
$(VERSION
).
$(SUFFIX
)
45 ifeq ($(UNAME
),Darwin
)
46 SINGLE_MODULE
=-Wl
,-single_module
48 export MACOSX_DEPLOYMENT_TARGET
=10.5
50 export MACOSX_DEPLOYMENT_TARGET
=10.4
57 CFLAGS
+=-D__C99FEATURES__
64 OPTIMIZATIONS
=-O2
-funroll-loops
-finline-functions
$(INLINE_OPTS
)
67 ifeq ($(CPU
), powerpc
)
68 OPTIMIZATIONS
+=-falign-loops
=16
71 CFLAGS
+= -fPIC
$(CPPFLAGS
)
72 DEPS
=bstraux.h bstrlib.h
74 SOURCES
=bstraux.c bstrlib.c
78 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
81 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
86 $(CC
) -MM
$(CPPFLAGS
) $< > $@.
$$$$; \
87 sed
's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.
$$$$ > $@
; \
90 library
: $(OUTPUT_LIB
) $(OUTPUT_A
)
92 $(OUTPUT_LIB
): $(DEPS
) $(OBJS
)
93 $(LINKER
) -o
$(OUTPUT_LIB
) $(OBJS
) $(SONAME
) $(LIBS
)
95 $(OUTPUT_A
): $(DEPS
) $(OBJS
)
96 $(AR
) cru
$(OUTPUT_A
) $(OBJS
)
102 rm -f
*.o
*.lo
*.la
*.so
*.dylib
*.a
106 ifneq ($(MAKECMDGOALS
),clean)
107 -include $(SOURCES
:%.c
=.
%.d
)