mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Sync up with makefile fixes from bootstrap pull req
This commit is contained in:
parent
4b2b866ba7
commit
f25d76747d
2 changed files with 33 additions and 35 deletions
12
Makefile
12
Makefile
|
@ -38,11 +38,11 @@ all : cyclone icyc libs
|
|||
test : libs $(TESTS)
|
||||
|
||||
example :
|
||||
cd $(EXAMPLE_DIR) ; make
|
||||
cd $(EXAMPLE_DIR) ; $(MAKE)
|
||||
|
||||
clean :
|
||||
rm -rf test.txt a.out *.so *.o *.a *.out tags cyclone icyc scheme/*.o scheme/*.so scheme/*.c scheme/*.meta srfi/*.c srfi/*.meta srfi/*.o srfi/*.so scheme/cyclone/*.o scheme/cyclone/*.so scheme/cyclone/*.c scheme/cyclone/*.meta cyclone.c dispatch.c icyc.c generate-c.c generate-c
|
||||
cd $(EXAMPLE_DIR) ; make clean
|
||||
cd $(EXAMPLE_DIR) ; $(MAKE) clean
|
||||
rm -rf html tests/*.o tests/*.c
|
||||
rm -f tests/srfi-28-tests
|
||||
rm -f tests/srfi-60-tests
|
||||
|
@ -107,10 +107,10 @@ indent : gc.c runtime.c mstreams.c $(HEADER_DIR)/*.h
|
|||
# This is a test directive used to test changes to a SLD file
|
||||
# EG: make sld SLDPATH=scheme/cyclone SLD=macros
|
||||
sld :
|
||||
cyclone $(SLDPATH)/$(SLD).sld && sudo cp $(SLDPATH)/$(SLD).c /usr/local/share/cyclone/$(SLDPATH)/ && sudo cp $(SLDPATH)/$(SLD).sld /usr/local/share/cyclone/$(SLDPATH)/ && sudo cp $(SLDPATH)/$(SLD).o /usr/local/share/cyclone/$(SLDPATH)/ && cyclone cyclone.scm && cyclone icyc.scm && sudo make install-bin
|
||||
cyclone $(SLDPATH)/$(SLD).sld && sudo cp $(SLDPATH)/$(SLD).c /usr/local/share/cyclone/$(SLDPATH)/ && sudo cp $(SLDPATH)/$(SLD).sld /usr/local/share/cyclone/$(SLDPATH)/ && sudo cp $(SLDPATH)/$(SLD).o /usr/local/share/cyclone/$(SLDPATH)/ && cyclone cyclone.scm && cyclone icyc.scm && sudo $(MAKE) install-bin
|
||||
|
||||
debug :
|
||||
sudo ls; cyclone scheme/cyclone/cgen.sld && sudo cp scheme/cyclone/cgen.* /usr/local/share/cyclone/scheme/cyclone/ && cyclone cyclone.scm && sudo make install-includes && sudo make install-libs && ./cyclone generate-c.scm
|
||||
sudo ls; cyclone scheme/cyclone/cgen.sld && sudo cp scheme/cyclone/cgen.* /usr/local/share/cyclone/scheme/cyclone/ && cyclone cyclone.scm && sudo $(MAKE) install-includes && sudo $(MAKE) install-libs && ./cyclone generate-c.scm
|
||||
|
||||
doc :
|
||||
doxygen Doxyfile
|
||||
|
@ -128,10 +128,10 @@ $(EXAMPLES) : %: %.scm
|
|||
$(CYCLONE) $<
|
||||
|
||||
game-of-life :
|
||||
cd $(EXAMPLE_DIR)/game-of-life ; make
|
||||
cd $(EXAMPLE_DIR)/game-of-life ; $(MAKE)
|
||||
|
||||
hello-library/hello :
|
||||
cd $(EXAMPLE_DIR)/hello-library ; make
|
||||
cd $(EXAMPLE_DIR)/hello-library ; $(MAKE)
|
||||
|
||||
libs : $(COBJECTS)
|
||||
|
||||
|
|
|
@ -4,14 +4,32 @@
|
|||
#
|
||||
# Configuration options for the makefile
|
||||
|
||||
OS ?= $(shell uname)
|
||||
CC ?= cc
|
||||
|
||||
LIBS = -pthread -lcyclone -lck -lm -ltommath
|
||||
ifneq ($(OS),FreeBSD)
|
||||
# libdl is part of libc on FreeBSD
|
||||
LIBS += -ldl
|
||||
endif
|
||||
|
||||
# Compiler options
|
||||
CFLAGS ?= -O2 -fPIC -rdynamic -Wall -Iinclude -L.
|
||||
COMP_CFLAGS ?= -O2 -fPIC -rdynamic -Wall -I$(PREFIX)/include -L$(PREFIX)/lib
|
||||
CFLAGS ?= -O2 -fPIC -Wall -Iinclude
|
||||
COMP_CFLAGS ?= -O2 -fPIC -Wall -I$(PREFIX)/include -L$(PREFIX)/lib -Wl,--export-dynamic
|
||||
# Use these lines instead for debugging or profiling
|
||||
#CFLAGS = -g -Wall
|
||||
#CFLAGS = -g -pg -Wall
|
||||
CC ?= cc
|
||||
LIBS = -pthread -lcyclone -lck -lm -ltommath -ldl
|
||||
|
||||
# Linker options
|
||||
LDFLAGS ?= -Wl,--export-dynamic -L.
|
||||
|
||||
# /usr/local is not in the search path by default on FreeBSD, so if libtommath and/or
|
||||
# concurrencykit was installed via Ports, it won't be picked up without explicitly looking
|
||||
# for it here
|
||||
ifeq ($(OS),FreeBSD)
|
||||
LDFLAGS += -L/usr/local/lib
|
||||
CFLAGS += -I/usr/local/include
|
||||
endif
|
||||
|
||||
# Commands "baked into" cyclone for invoking the C compiler
|
||||
CC_PROG ?= "$(CC) ~src-file~ $(COMP_CFLAGS) -c -o ~exec-file~.o"
|
||||
|
@ -44,41 +62,21 @@ CYC_PLATFORM_HAS_FMEMOPEN := $(shell echo "main(){char *buf; fmemopen(&buf, 0, \
|
|||
|
||||
# code from chibi's makefile to detect platform
|
||||
ifndef PLATFORM
|
||||
ifeq ($(shell uname),Darwin)
|
||||
ifeq ($(OS),Darwin)
|
||||
PLATFORM=macosx
|
||||
else
|
||||
ifeq ($(shell uname),FreeBSD)
|
||||
else ifneq (,$(findstring $(OS),FreeBSD NetBSD OpenBSD DragonFly))
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname),NetBSD)
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname),OpenBSD)
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname),DragonFly)
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname -o),Msys)
|
||||
else ifeq ($(shell uname -o),Msys)
|
||||
PLATFORM=mingw
|
||||
SOLIBDIR = $(BINDIR)
|
||||
DIFFOPTS = -b
|
||||
else
|
||||
ifeq ($(shell uname -o),Cygwin)
|
||||
else ifeq ($(shell uname -o),Cygwin)
|
||||
PLATFORM=cygwin
|
||||
SOLIBDIR = $(BINDIR)
|
||||
DIFFOPTS = -b
|
||||
else
|
||||
ifeq ($(shell uname -o),GNU/Linux)
|
||||
else ifeq ($(shell uname -o),GNU/Linux)
|
||||
PLATFORM=linux
|
||||
else
|
||||
PLATFORM=unix
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Add table
Reference in a new issue