-# Copyright (C) 2002 Cluster File Systems, Inc.
-#
-# This code is issued under the GNU General Public License.
-# See the file COPYING in this distribution
-
my_sources = api-errno.c api-ni.c api-wrap.c \
lib-init.c lib-me.c lib-msg.c lib-eq.c \
lib-md.c lib-move.c lib-ni.c lib-pid.c
endif
if MODULES
+
+if LINUX
modulenet_DATA = portals$(KMODEXT)
+endif # LINUX
+
+if DARWIN
+macos_PROGRAMS := portals
+
+portals_SOURCES := api-errno.c api-ni.c api-wrap.c
+portals_SOURCES += lib-init.c lib-me.c lib-msg.c lib-eq.c lib-md.c
+portals_SOURCES += lib-move.c lib-ni.c lib-pid.c module.c
+
+portals_CFLAGS := $(EXTRA_KCFLAGS)
+portals_LDFLAGS := $(EXTRA_KLDFLAGS)
+portals_LDADD := $(EXTRA_KLIBS)
+
+plist_DATA := Info.plist
+
+install_data_hook := fix-kext-ownership
+
+endif # DARWIN
+
endif # MODULES
endif # CRAY_PORTALS
-MOSTLYCLEANFILES = *.o *.ko *.mod.c
+install-data-hook: $(install_data_hook)
+
+EXTRA_DIST := Info.plist
+
+MOSTLYCLEANFILES = .*.flags *.o *.ko *.mod.c portals
DIST_SOURCES = $(portals-objs:%.o=%.c)