]> git.stg.codes - stg.git/blob - stglibs/Makefile.in
Merge branch 'stg-2.409-radius'
[stg.git] / stglibs / Makefile.in
1 ###############################################################################
2 # $Id: Makefile.in,v 1.28 2009/03/03 15:50:14 faust Exp $
3 ###############################################################################
4
5 include ../../Makefile.conf
6
7 PROG = lib$(LIB_NAME).a
8
9 SEARCH_DIRS = -I ../../include -I . -I ./include
10
11 ifeq ($(STG_TIME), yes)
12 DEFS += -DSTG_TIME
13 endif
14
15 ifneq ($(LIB_DEFS),)
16 DEFS += $(LIB_DEFS)
17 endif
18
19 ifneq ($(LIB_INCS),)
20 SEARCH_DIRS += $(LIB_INCS)
21 endif
22
23 OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
24
25 CXXFLAGS += -fPIC $(SEARCH_DIRS) $(DEFS)
26 CFLAGS += -fPIC $(SEARCH_DIRS) $(DEFS)
27
28 all: $(PROG)
29
30 $(PROG): $(OBJS)
31         ar rc lib$(LIB_NAME).a $(OBJS)
32         ranlib lib$(LIB_NAME).a
33
34 clean:
35         rm -f deps $(PROG) *.o *.a *.so tags *.*~ 
36
37 install: $(PROG)
38 ifeq ($(DEBUG), yes)
39         mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg
40         install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
41 else
42         mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg
43         install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG)
44 endif
45         mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/include/stg
46         install -m $(DATA_MODE) -o $(OWNER) $(addprefix include/stg/,$(INCS)) $(PREFIX)/usr/include/stg/
47
48 uninstall:
49         rm -f $(PREFIX)/usr/lib/stg/$(PROG)
50         for file in $(INCS); do \
51             rm -f $(PREFIX)/usr/include/stg/$$file; \
52         done
53
54 ifneq ($(MAKECMDGOALS),includes)
55 ifneq ($(MAKECMDGOALS),clean)
56 ifneq ($(MAKECMDGOALS),uninstall)
57 -include deps
58 endif
59 endif
60 endif
61
62 deps:   $(SRCS) ../../Makefile.conf
63         @>deps ;\
64         for file in $(SRCS); do\
65           echo "$$file" | grep ".c$$" > /dev/null;\
66           if [ $$? -eq 0 ];\
67           then\
68             echo "`$(CC) $(CFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
69             printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
70           else\
71             echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
72             printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
73           fi;\
74         done