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-10 14:41:50 +05:30
|
|
|
#ALL += proc/lib$(NAME).a
|
|
|
|
#INSTALL += $(usr/lib)/lib$(NAME).a # plus $(usr/include)$(NAME) gunk
|
2002-10-10 12:38:13 +05:30
|
|
|
LIB_CFLAGS := $(CFLAGS)
|
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)
|
|
|
|
LIB_CFLAGS += -fpic
|
2002-10-10 14:41:50 +05:30
|
|
|
LIBPROC := proc/$(SONAME)
|
|
|
|
else
|
|
|
|
LIBPROC := proc/lib$(NAME).a
|
2002-10-10 12:38:13 +05:30
|
|
|
endif
|
2002-10-09 02:47:06 +05:30
|
|
|
|
2002-10-10 14:41:50 +05:30
|
|
|
LIBSRC := $(wildcard proc/*.c)
|
|
|
|
LIBHDR := $(wildcard proc/*.h)
|
|
|
|
LIBOBJ := $(LIBSRC:.c=.o)
|
2002-10-10 12:38:13 +05:30
|
|
|
|
2002-10-11 04:10:35 +05:30
|
|
|
|
|
|
|
LIB_X := COPYING Makefile.noam module.mk
|
|
|
|
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-10 14:41:50 +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
|
|
|
|
$(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
|
|
|
|
|
|
|
|
|
|
|
# CUSTOM c -> o rule so that command-line has minimal whitespace
|
|
|
|
%.o : %.c
|
2002-10-10 12:38:13 +05:30
|
|
|
$(strip $(CC) $(LIB_CFLAGS) -c $<)
|
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-10-09 02:47:06 +05:30
|
|
|
ifdef MINORVERSION
|
2002-10-10 15:50:13 +05:30
|
|
|
$(strip $(CC) $(LIB_CFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\" -c -o $@ $<)
|
2002-10-09 02:47:06 +05:30
|
|
|
else
|
2002-10-10 15:50:13 +05:30
|
|
|
$(strip $(CC) $(LIB_CFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -c -o $@ $<)
|
2002-10-09 02:47:06 +05:30
|
|
|
endif
|