procps/proc/module.mk

74 lines
1.9 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
2002-10-10 12:38:13 +05:30
ifeq ($(SHARED),1)
ALL += proc/$(SONAME)
INSTALL += $(lib)/$(SONAME)
FPIC := -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
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
$(CC) -c $(CFLAGS) $(FPIC) $< -o $@
2002-10-11 04:10:35 +05:30
2002-10-21 14:47:39 +05:30
LIB_X := COPYING module.mk
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
2002-10-10 14:41:50 +05:30
proc/$(SONAME): $(LIBOBJ)
$(CC) -shared -Wl,-soname,$(SONAME) -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)
$(strip $(CC) $(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)
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
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
2002-11-09 07:30:52 +05:30
$(CC) $(CFLAGS) $(FPIC) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\" -c -o $@ $<