root/common/include/lib.mak.in @ 16c16f01a7ceeab9b205f6d94920f94fbdd4da9f

Revision 16c16f01a7ceeab9b205f6d94920f94fbdd4da9f, 1.4 KB (checked in by dsmith <dsmith@…>, 6 years ago)

Corrected installation directory creation; nonparallel make

git-svn-id: http://abstrakraft.org/cwiid/svn/trunk@41 918edb2d-ff29-0410-9de2-eb38e7f22bc7

  • Property mode set to 100644
Line 
1#Copyright (C) 2007 L. Donnie Smith
2
3HEADER     = $(LIB_NAME).h
4STATIC_LIB = lib$(LIB_NAME).a
5LINK_NAME  = lib$(LIB_NAME).so
6SO_NAME    = $(LINK_NAME).$(MAJOR_VER)
7SHARED_LIB = $(SO_NAME).$(MINOR_VER)
8
9OBJECTS = $(SOURCES:.c=.o)
10DEPS    = $(SOURCES:.c=.d)
11
12CFLAGS += -fpic
13
14all: static shared
15
16static: $(STATIC_LIB)
17
18shared: $(SHARED_LIB)
19
20$(STATIC_LIB): $(OBJECTS)
21        ar rcs $(STATIC_LIB) $(OBJECTS)
22
23$(SHARED_LIB): $(OBJECTS)
24        $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) $(LDLIBS) \
25              -o $(SHARED_LIB) $(OBJECTS)
26
27install: install_header install_static install_shared
28
29install_header: $(INC_INST_DIR)
30        install $(LIB_NAME).h $(INC_INST_DIR)
31
32$(INC_INST_DIR):
33        install -d $(INC_INST_DIR)
34
35install_static: static $(LIB_INST_DIR)
36        install $(STATIC_LIB) $(LIB_INST_DIR)
37
38install_shared: shared $(LIB_INST_DIR)
39        install $(SHARED_LIB) $(LIB_INST_DIR)
40        ln -sf $(SHARED_LIB) $(LIB_INST_DIR)/$(SO_NAME)
41        ln -sf $(SO_NAME) $(LIB_INST_DIR)/$(LINK_NAME)
42        @LDCONFIG@
43
44$(LIB_INST_DIR):
45        install -d $(LIB_INST_DIR)
46
47clean:
48        rm -f $(STATIC_LIB) $(SHARED_LIB) $(OBJECTS) $(DEPS)
49
50uninstall:
51        rm -f $(INC_INST_DIR)/$(LIB_NAME).h $(LIB_INST_DIR)/$(STATIC_LIB) \
52            $(LIB_INST_DIR)/$(LINK_NAME)*
53
54ifneq ($(MAKECMDGOALS),clean)
55ifneq ($(MAKECMDGOALS),distclean)
56include $(COMMON)/include/dep.mak
57-include $(DEPS)
58endif
59endif
60
61.PHONY: all static shared install install_header install_static install_shared clean uninstall
Note: See TracBrowser for help on using the browser.