procps/proc/module.mk

81 lines
2.2 KiB
Makefile
Raw Normal View History

2002-10-10 12:38:13 +05:30
# This file gets included into the main Makefile, in the top directory.
2002-10-09 02:47:06 +05:30
2002-10-10 14:41:50 +05:30
# for lib$(NAME).so and /usr/include/($NAME) and such
2002-10-10 12:38:13 +05:30
NAME := proc
2002-10-09 02:47:06 +05:30
2002-10-10 14:41:50 +05:30
SHARED := 1
2002-10-09 02:47:06 +05:30
2002-10-10 12:38:13 +05:30
SONAME := lib$(NAME).so.$(LIBVERSION)
2002-10-09 02:47:06 +05:30
2002-10-13 00:28:39 +05:30
LIBSRC := $(wildcard proc/*.c)
LIBHDR := $(wildcard proc/*.h)
LIBOBJ := $(LIBSRC:.c=.o)
2002-10-10 14:41:50 +05:30
#ALL += proc/lib$(NAME).a
#INSTALL += $(usr/lib)/lib$(NAME).a # plus $(usr/include)$(NAME) gunk
2002-10-09 02:47:06 +05:30
2003-02-17 06:27:15 +05:30
FPIC := -fpic
2002-10-10 12:38:13 +05:30
ifeq ($(SHARED),1)
ALL += proc/$(SONAME)
INSTALL += $(lib)/$(SONAME)
2003-02-17 06:27:15 +05:30
LIBFLAGS := -DSHARED=1 $(FPIC)
2002-10-10 14:41:50 +05:30
LIBPROC := proc/$(SONAME)
else
2002-10-24 13:19:16 +05:30
ALL += proc/lib$(NAME).a
2003-02-17 06:27:15 +05:30
LIBFLAGS := -DSHARED=0
2002-10-10 14:41:50 +05:30
LIBPROC := proc/lib$(NAME).a
2002-10-10 12:38:13 +05:30
endif
2002-10-09 02:47:06 +05:30
# Separate rule for this directory, to use -fpic or -fPIC
2002-11-09 07:30:52 +05:30
$(filter-out proc/version.o,$(LIBOBJ)): proc/%.o: proc/%.c
2003-09-01 05:48:58 +05:30
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(LIBFLAGS) $< -o $@
2002-10-11 04:10:35 +05:30
2003-01-25 13:11:45 +05:30
LIB_X := COPYING module.mk library.map
2002-10-11 04:10:35 +05:30
TARFILES += $(LIBSRC) $(LIBHDR) $(addprefix proc/,$(LIB_X))
2002-10-10 14:41:50 +05:30
# Clean away all output files, .depend, and symlinks.
# Use wildcards in case the version has changed.
CLEAN += proc/.depend proc/lib*.so* proc/lib*.a $(LIBOBJ)
2002-10-10 15:50:13 +05:30
DIRS += proc/
2002-10-10 12:38:13 +05:30
2002-10-24 13:19:16 +05:30
proc/lib$(NAME).a: $(LIBOBJ)
$(AR) rcs $@ $^
2002-10-09 02:47:06 +05:30
.PHONY: proc/$(SONAME)
2003-01-24 15:45:23 +05:30
#proc/$(SONAME): proc/library.map
2002-10-10 14:41:50 +05:30
proc/$(SONAME): $(LIBOBJ)
2003-01-24 15:45:23 +05:30
$(CC) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $^ -lc
cd proc && $(ln_sf) $(SONAME) lib$(NAME).so
2002-10-09 02:47:06 +05:30
2002-10-10 14:41:50 +05:30
# AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT
proc/.depend: $(LIBSRC) $(LIBHDR)
2003-09-01 05:48:58 +05:30
$(strip $(CC) $(ALL_CPPFLAGS) $(LIB_CFLAGS) -MM -MG $(LIBSRC) > $@)
2002-10-10 15:50:13 +05:30
ifneq ($(MAKECMDGOALS),clean)
2002-10-11 04:10:35 +05:30
ifneq ($(MAKECMDGOALS),tar)
2004-01-30 03:58:13 +05:30
ifneq ($(MAKECMDGOALS),extratar)
2002-10-10 14:41:50 +05:30
-include proc/.depend
2002-10-10 15:50:13 +05:30
endif
2002-10-11 04:10:35 +05:30
endif
2004-01-30 03:58:13 +05:30
endif
2002-10-09 02:47:06 +05:30
2002-10-10 14:41:50 +05:30
$(lib)/$(SONAME) : proc/$(SONAME)
$(install) --mode a=rx --strip $< $@
cd $(lib) && $(ln_sf) $(SONAME) lib$(NAME).so
2002-10-10 14:41:50 +05:30
$(ldconfig)
2002-10-09 02:47:06 +05:30
2002-10-10 14:41:50 +05:30
#$(usr/lib)/lib$(NAME).a : proc/lib$(NAME).a
# $(install) --mode a=r --strip $< $@
2002-10-09 02:47:06 +05:30
2002-10-10 14:41:50 +05:30
# Junk anyway... supposed to go in /usr/include/$(NAME)
#$(HDRFILES) ??? : $(addprefix proc/,$(HDRFILES)) ???
# $(install) --mode a=r $< $@
2002-10-09 02:47:06 +05:30
2002-10-10 14:41:50 +05:30
proc/version.o: proc/version.c proc/version.h
2003-09-01 05:48:58 +05:30
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(LIBFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\" -c -o $@ $<