# # Makefile for building World example for hugs on Win32, using # Cygwin's GNU make, Microsoft's Visual C++ compiler and GreenCard. # # site-specific definitions: # Path to GreenCard (source) directory. # N.B.! GreenCard expects a Win32-style path here: GCDIR ?= C:\\greencard\\greencard-3.00 # Hugs executable: FFIHUGS = ffihugs # end site-specific definitions # greencard executable: GC = greencard # GreenCard sub-directories and options (requires GCDIR be defined) # N.B. We'd like to put these in Makedefs.common, but unfortunately, # GreenCard cares about whether we use forward or backward slashes as # path delimeter... GCHUGSLIB = $(GCDIR)\\lib OBJS = World.o World_stub_ffi.o all : World.dll World.dll : $(OBJS) $(LINK) $(LDFLAGS) -out:$@ $(OBJS) # Rule for building .hs and .c files from .gc files: %.hs %_stub_ffi.c %_stub_ffi.h : %.gc $(GC) $(GCOPTS) $< %.dll : %.hs %_stub_ffi.c %_stub_ffi.h $(FFIHUGS) -P$(GCHUGSLIB): +G $< +L"$*_stub_ffi.c" $(LIBS) clean : FRC rm -f *.o *.dll *.exp *~ *.ilk *.lib *.pdb World.hs FRC: