build: Disable implicit rules in build/ dir.
[gfxprim.git] / build / Makefile
blobd4a8b5d45a4759c5b1f79697d354935f3467b790
1 LIB_OBJECTS=$(shell ./get_objs.sh)
3 .SUFFIXES:
5 include ../libver.mk
7 LIB_NAME=libGP
9 STATIC_LIB=$(LIB_NAME).$(LIB_VERSION).a
10 DYNAMIC_LIB=$(LIB_NAME).so.$(LIB_VERSION).$(LIB_RELEASE)
11 SONAME=$(LIB_NAME).so.$(LIB_MAJOR)
12 SYMLINKS=$(LIB_NAME).so.$(LIB_MAJOR) $(LIB_NAME).so
14 all: $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS)
16 rebuild: all
18 clean:
19 ifdef VERBOSE
20 rm -rf $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS)
21 else
22 @echo "RM $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS)"
23 @rm -rf $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS)
24 endif
26 $(STATIC_LIB): $(LIB_OBJECTS)
27 ifdef VERBOSE
28 $(AR) rcs $@ $^
29 else
30 @echo "AR $@"
31 @$(AR) rcs $@ $^
32 endif
34 $(DYNAMIC_LIB): $(LIB_OBJECTS)
35 ifdef VERBOSE
36 $(CC) -fPIC -dPIC --shared -Wl,-soname -Wl,$(SONAME) $^ -o $@
37 else
38 @echo "LD $@"
39 @$(CC) -fPIC -dPIC --shared -Wl,-soname -Wl,$(SONAME) $^ -o $@
40 endif
42 $(SYMLINKS): $(DYNAMIC_LIB)
43 ifdef VERBOSE
44 rm -f $@
45 ln -s $< $@
46 else
47 @echo "LN $@"
48 @rm -f $@
49 @ln -s $< $@
50 endif