#
# Makefile for the Linux proc filesystem routines.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile.

O_TARGET := proc.o

export-objs := root.o

obj-y    := inode.o root.o base.o generic.o array.o \
		kmsg.o proc_tty.o proc_misc.o kcore.o

ifeq ($(CONFIG_PROC_DEVICETREE),y)
obj-y += proc_devtree.o
endif

ifeq ($(CONFIG_TRUSTEES),y)
obj-y += trustee.o
endif

obj-$(CONFIG_PROC_CONFIG) += kconfig.o

include $(TOPDIR)/Rules.make

CONFGEN_FLAGS := -a kconfig_data -q 'static const'

ifeq ($(CONFIG_PROC_CONFIG_GZ),y)
  CONFGEN_FLAGS += -z gzip
else
  ifeq ($(CONFIG_PROC_CONFIG_BZ2),y)
    CONFGEN_FLAGS += -z bzip2
  endif
endif

kconfig.o: confdata.h

confdata.h: $(TOPDIR)/.config $(TOPDIR)/scripts/carray
	$(TOPDIR)/scripts/carray $(CONFGEN_FLAGS) -o $@ < $(TOPDIR)/.config

$(TOPDIR)/scripts/carray: $(TOPDIR)/scripts/carray.c
	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
