Sync up with makefile fixes from bootstrap pull req

This commit is contained in:
Justin Ethier 2017-11-08 18:04:39 -05:00
parent 4b2b866ba7
commit f25d76747d
2 changed files with 33 additions and 35 deletions

View file

@ -38,11 +38,11 @@ all : cyclone icyc libs
test : libs $(TESTS) test : libs $(TESTS)
example : example :
cd $(EXAMPLE_DIR) ; make cd $(EXAMPLE_DIR) ; $(MAKE)
clean : 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 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 -rf html tests/*.o tests/*.c
rm -f tests/srfi-28-tests rm -f tests/srfi-28-tests
rm -f tests/srfi-60-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 # This is a test directive used to test changes to a SLD file
# EG: make sld SLDPATH=scheme/cyclone SLD=macros # EG: make sld SLDPATH=scheme/cyclone SLD=macros
sld : 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 : 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 : doc :
doxygen Doxyfile doxygen Doxyfile
@ -128,10 +128,10 @@ $(EXAMPLES) : %: %.scm
$(CYCLONE) $< $(CYCLONE) $<
game-of-life : game-of-life :
cd $(EXAMPLE_DIR)/game-of-life ; make cd $(EXAMPLE_DIR)/game-of-life ; $(MAKE)
hello-library/hello : hello-library/hello :
cd $(EXAMPLE_DIR)/hello-library ; make cd $(EXAMPLE_DIR)/hello-library ; $(MAKE)
libs : $(COBJECTS) libs : $(COBJECTS)

View file

@ -4,14 +4,32 @@
# #
# Configuration options for the makefile # 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 # Compiler options
CFLAGS ?= -O2 -fPIC -rdynamic -Wall -Iinclude -L. CFLAGS ?= -O2 -fPIC -Wall -Iinclude
COMP_CFLAGS ?= -O2 -fPIC -rdynamic -Wall -I$(PREFIX)/include -L$(PREFIX)/lib COMP_CFLAGS ?= -O2 -fPIC -Wall -I$(PREFIX)/include -L$(PREFIX)/lib -Wl,--export-dynamic
# Use these lines instead for debugging or profiling # Use these lines instead for debugging or profiling
#CFLAGS = -g -Wall #CFLAGS = -g -Wall
#CFLAGS = -g -pg -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 # Commands "baked into" cyclone for invoking the C compiler
CC_PROG ?= "$(CC) ~src-file~ $(COMP_CFLAGS) -c -o ~exec-file~.o" 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 # code from chibi's makefile to detect platform
ifndef PLATFORM ifndef PLATFORM
ifeq ($(shell uname),Darwin) ifeq ($(OS),Darwin)
PLATFORM=macosx PLATFORM=macosx
else else ifneq (,$(findstring $(OS),FreeBSD NetBSD OpenBSD DragonFly))
ifeq ($(shell uname),FreeBSD)
PLATFORM=bsd PLATFORM=bsd
else else ifeq ($(shell uname -o),Msys)
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)
PLATFORM=mingw PLATFORM=mingw
SOLIBDIR = $(BINDIR) SOLIBDIR = $(BINDIR)
DIFFOPTS = -b DIFFOPTS = -b
else else ifeq ($(shell uname -o),Cygwin)
ifeq ($(shell uname -o),Cygwin)
PLATFORM=cygwin PLATFORM=cygwin
SOLIBDIR = $(BINDIR) SOLIBDIR = $(BINDIR)
DIFFOPTS = -b DIFFOPTS = -b
else else ifeq ($(shell uname -o),GNU/Linux)
ifeq ($(shell uname -o),GNU/Linux)
PLATFORM=linux PLATFORM=linux
else else
PLATFORM=unix PLATFORM=unix
endif endif
endif endif
endif
endif
endif
endif
endif
endif
endif