|
1 # Make sure you include -DHAVE_SNPRINTF in CFLAGS if your system |
|
2 # does have snprintf! |
|
3 |
|
4 # If you need (long long int) support and you sprintf supports it, |
|
5 # define -DSNPRINTF_LONGLONG_SUPPORT |
|
6 |
|
7 CC = gcc |
|
8 |
|
9 CFLAGS = -DPREFER_PORTABLE_SNPRINTF -O3 \ |
|
10 -Wall -Wpointer-arith -Wwrite-strings \ |
|
11 -Wcast-qual -Wcast-align -Waggregate-return \ |
|
12 -Wmissing-prototypes -Wmissing-declarations \ |
|
13 -Wshadow -Wstrict-prototypes |
|
14 |
|
15 # -DNEED_ASPRINTF -DNEED_ASNPRINTF -DNEED_VASPRINTF -DNEED_VASNPRINTF |
|
16 # -DNEED_SNPRINTF_ONLY |
|
17 |
|
18 # Digital Unix: native compiler usually produces better code than gcc |
|
19 #CC = cc |
|
20 #CFLAGS = -DPREFER_PORTABLE_SNPRINTF -O4 -std1 -arch host |
|
21 |
|
22 # Recommend to leave COMPATIBILITY empty for normal use. |
|
23 # Should be set for bug compatibility when running tests |
|
24 # too keep them less chatty. |
|
25 COMPATIBILITY = |
|
26 |
|
27 #COMPATIBILITY = -DSOLARIS_BUG_COMPATIBLE |
|
28 #COMPATIBILITY = -DHPUX_BUG_COMPATIBLE |
|
29 #COMPATIBILITY = -DDIGITAL_UNIX_BUG_COMPATIBLE |
|
30 #COMPATIBILITY = -DPERL_BUG_COMPATIBLE |
|
31 #COMPATIBILITY = -DLINUX_COMPATIBLE |
|
32 |
|
33 .c.o: |
|
34 rm -f $@ |
|
35 $(CC) $(CFLAGS) $(COMPATIBILITY) -c $*.c |
|
36 |
|
37 all:snprintf.o Makefile |
|
38 |
|
39 test::snprintf.o test.c Makefile |
|
40 $(CC) $(CFLAGS) $(COMPATIBILITY) snprintf.o -o $@ test.c |
|
41 |
|
42 clean: |
|
43 /usr/bin/rm -f *.o test core |