procps/proc/module.mk

74 lines
1.9 KiB
Makefile
Raw Normal View History

2002-10-10 07:08:13 +00:00
# This file gets included into the main Makefile, in the top directory.
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
# for lib$(NAME).so and /usr/include/($NAME) and such
2002-10-10 07:08:13 +00:00
NAME := proc
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
SHARED := 1
2002-10-08 21:17:06 +00:00
2002-10-10 07:08:13 +00:00
SONAME := lib$(NAME).so.$(LIBVERSION)
2002-10-08 21:17:06 +00:00
2002-10-12 18:58:39 +00:00
LIBSRC := $(wildcard proc/*.c)
LIBHDR := $(wildcard proc/*.h)
LIBOBJ := $(LIBSRC:.c=.o)
2002-10-10 09:11:50 +00:00
#ALL += proc/lib$(NAME).a
#INSTALL += $(usr/lib)/lib$(NAME).a # plus $(usr/include)$(NAME) gunk
2002-10-08 21:17:06 +00:00
2002-10-10 07:08:13 +00:00
ifeq ($(SHARED),1)
ALL += proc/$(SONAME)
INSTALL += $(lib)/$(SONAME)
2002-10-12 18:58:39 +00:00
$(LIBOBJ) : CFLAGS += -fpic
2002-10-10 09:11:50 +00:00
LIBPROC := proc/$(SONAME)
else
LIBPROC := proc/lib$(NAME).a
2002-10-10 07:08:13 +00:00
endif
2002-10-08 21:17:06 +00:00
2002-10-10 22:40:35 +00:00
LIB_X := COPYING Makefile.noam module.mk
TARFILES += $(LIBSRC) $(LIBHDR) $(addprefix proc/,$(LIB_X))
2002-10-10 09:11:50 +00:00
# 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 10:20:13 +00:00
DIRS += proc/
2002-10-10 07:08:13 +00:00
2002-10-10 09:11:50 +00:00
#proc/lib$(NAME).a: $(LIBOBJ)
# $(AR) rcs $@ $^
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
proc/$(SONAME): $(LIBOBJ)
$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^ -lc
cd proc && $(ln-sf) $(SONAME) lib$(NAME).so
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
# AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT
proc/.depend: $(LIBSRC) $(LIBHDR)
$(strip $(CC) $(LIB_CFLAGS) -MM -MG $(LIBSRC) > $@)
2002-10-10 10:20:13 +00:00
ifneq ($(MAKECMDGOALS),clean)
2002-10-10 22:40:35 +00:00
ifneq ($(MAKECMDGOALS),tar)
2002-10-10 09:11:50 +00:00
-include proc/.depend
2002-10-10 10:20:13 +00:00
endif
2002-10-10 22:40:35 +00:00
endif
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
$(lib)/$(SONAME) : proc/$(SONAME)
$(install) --mode a=rx --strip $< $@
cd $(lib) && $(ln-sf) $(SONAME) lib$(NAME).so
$(ldconfig)
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
#$(usr/lib)/lib$(NAME).a : proc/lib$(NAME).a
# $(install) --mode a=r --strip $< $@
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
# Junk anyway... supposed to go in /usr/include/$(NAME)
#$(HDRFILES) ??? : $(addprefix proc/,$(HDRFILES)) ???
# $(install) --mode a=r $< $@
2002-10-08 21:17:06 +00:00
2002-10-10 09:11:50 +00:00
proc/version.o: proc/version.c proc/version.h
2002-10-08 21:17:06 +00:00
ifdef MINORVERSION
2002-10-12 19:30:40 +00:00
$(strip $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\" -c -o $@ $<)
2002-10-08 21:17:06 +00:00
else
2002-10-12 19:30:40 +00:00
$(strip $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -c -o $@ $<)
2002-10-08 21:17:06 +00:00
endif