Added install/uninstall stubs

This commit is contained in:
Justin Ethier 2015-07-15 23:02:30 -04:00
parent 537052b87e
commit cdcf0fefc9
2 changed files with 34 additions and 1 deletions

View file

@ -2,6 +2,8 @@
# Copyright (c) 2014, Justin Ethier # Copyright (c) 2014, Justin Ethier
# All rights reserved. # All rights reserved.
include Makefile.config
TESTSCM = unit-tests TESTSCM = unit-tests
TESTFILES = $(addprefix tests/, $(addsuffix .scm, $(TESTSCM))) TESTFILES = $(addprefix tests/, $(addsuffix .scm, $(TESTSCM)))
@ -55,7 +57,7 @@ libcyclone.so.1: runtime.c runtime.h
libcyclone.a: runtime.c runtime.h dispatch.c libcyclone.a: runtime.c runtime.h dispatch.c
gcc -g -c dispatch.c -o dispatch.o gcc -g -c dispatch.c -o dispatch.o
gcc -g -c runtime.c -o runtime.o gcc -g -c runtime.c -o runtime.o
ar rcs libcyclone.a runtime.o dispatch.o $(AR) rcs libcyclone.a runtime.o dispatch.o
# Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html # Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
# Note compiler will have to link to this, eg: # Note compiler will have to link to this, eg:
#Linking against static library #Linking against static library
@ -168,3 +170,13 @@ tags:
clean: clean:
rm -rf a.out *.o *.so *.a *.out tags cyclone icyc scheme/*.o scheme/*.c rm -rf a.out *.o *.so *.a *.out tags cyclone icyc scheme/*.o scheme/*.c
$(foreach f,$(TESTSCM), rm -rf $(f) $(f).c tests/$(f).c;) $(foreach f,$(TESTSCM), rm -rf $(f) $(f).c tests/$(f).c;)
install: all
$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m0755 cyclone $(DESTDIR)$(BINDIR)/
$(INSTALL) -m0755 icyc $(DESTDIR)$(BINDIR)/
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/cyclone
$(RM) $(DESTDIR)$(BINDIR)/icyc

21
Makefile.config Normal file
View file

@ -0,0 +1,21 @@
# install configuration
CC ?= cc
AR ?= ar
#CD ?= cd
RM ?= rm -f
#LS ?= ls
#CP ?= cp
#LN ?= ln
INSTALL ?= install
MKDIR ?= $(INSTALL) -d
RMDIR ?= rmdir
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib
INCDIR ?= $(PREFIX)/include/cyclone
SLDDIR ?= $(PREFIX)/share/cyclone
DESTDIR ?=