Statistics
| Branch: | Revision:

grapes / som / utils.mak @ 5731f27d

History | View | Annotate | Download (973 Bytes)

1
cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
2
              > /dev/null 2>&1; then echo "$(1)"; fi ;)
3

    
4
ld-option = $(shell if echo "int main(){return 0;}" | \
5
		$(CC) $(CFLAGS) $(1) -o /dev/null -xc - \
6
		> /dev/null 2>&1; then echo "$(1)"; fi ;)
7

    
8

    
9

    
10
CFLAGS = -g -Wall
11
CFLAGS += $(call cc-option, -Wdeclaration-after-statement)
12
CFLAGS += $(call cc-option, -Wno-switch)
13
CFLAGS += $(call cc-option, -Wdisabled-optimization)
14
CFLAGS += $(call cc-option, -Wpointer-arith)
15
CFLAGS += $(call cc-option, -Wredundant-decls)
16
CFLAGS += $(call cc-option, -Wno-pointer-sign)
17
CFLAGS += $(call cc-option, -Wcast-qual)
18
CFLAGS += $(call cc-option, -Wwrite-strings)
19
CFLAGS += $(call cc-option, -Wtype-limits)
20
CFLAGS += $(call cc-option, -Wundef)
21

    
22
CFLAGS += $(call cc-option, -funit-at-a-time)
23

    
24
CPPFLAGS = -I$(BASE)/include -I$(BASE)/som
25

    
26
LIBCOMMON = libsom.a
27

    
28
%.a: $(OBJS)
29
	ar rcs $@ $^
30

    
31
libcommon: $(OBJS)
32
	ar rcs $(BASE)/som/$(LIBCOMMON) $^
33
clean::
34
	rm -f *.a
35
	rm -f *.o