# 
# Sample makefile for a bundle example
#

CC = gcc

# OpenStep directory
OSDIR = ../..

# Define HAVE_LIBDLD only if dld works on your machine (and it's installed)
# also define the DLDLIB variable appropriately.
# Define DEBUG to see lots of messages
#DEFINES    = -DDEBUG -DHAVE_LIBDLD
#DEFINES    = -DHAVE_LIBDLD

# Location of the DLD library and include files (if not in a standard path)
DLDINCLUDE = -I$(OSDIR)/..
#DLDLIB     = -L$(OSDIR)/../dld -ldld

# Location for libcoll library and includes (if not in a standard path)
COLLINCLUDE = 
COLLLIB     = -lcoll

# On SPARCS define -static to avoid shared libraries
#LDFLAGS     = -static

BUNDLES    = LoadMe

#---------------------------- end of configuration -----------------------

NAME   = bundle
COMDIR = .
OTHER_CFLAGS = -I$(OSDIR) -I$(COMDIR) $(COLLINCLUDE) $(DLDINCLUDE) $(DEFINES)

#Source files
CLASSES = $(OSDIR)/appkit/NXBundle.m
HFILES  = $(OSDIR)/appkit/NXBundle.h
MFILES  = bundle.m

CFILES  = $(OSDIR)/objc2/hashtable.c $(OSDIR)/objc2/objc-load.c \
	$(OSDIR)/objc2/find_exec.c
CHFILES = $(OSDIR)/appkit/stdmacros.h

MAKEFILEDIR = $(COMDIR)

LIBS = $(DLDLIB) $(COLLLIB) -lobjc

include $(MAKEFILEDIR)/common.make

all:: $(NAME) bundles

$(NAME): $(OFILES)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(NAME) $(OFILES) $(LIBS)

bundles:
	for i in $(BUNDLES); do \
	  (cd $$i.bproj; $(MAKE) all); \
	done

cleanothers:
	rm -f $(OFILES)

cleanbundles:
	for i in $(BUNDLES); do \
	  (cd $$i.bproj; $(MAKE) clean); \
	done

realclean:: clean cleanbundles cleanothers

install:

