]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Switched build over to plain-old Makefile
authorMike Lowis <mike.lowis@gentex.com>
Fri, 11 Dec 2015 16:43:29 +0000 (16:43 +0000)
committerMike Lowis <mike.lowis@gentex.com>
Fri, 11 Dec 2015 16:43:29 +0000 (16:43 +0000)
.gitignore
.gitmodules
Gemfile [deleted file]
Gemfile.lock [deleted file]
Makefile [new file with mode: 0644]
README.md
build-system [deleted submodule]
build.rb [deleted file]
spec/spec_helper.rb

index ccc2726a4ff9d4e9eeaea005237dd3dba457e38b..0b742e65e9cb562f4c6ba376c33d5f4093263407 100644 (file)
@@ -7,8 +7,7 @@ cscope.out
 *.lib
 *~
 *.d
-
-Makefile
 .sconsign.dblite
 .DS_Store
 .rsconscache
+sclpl
index 7012a594eab5728c88e8f86bb801db2a043db174..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[submodule "build-system"]
-    path = build-system
-    url = https://github.com/mikedlowis/build-system.git
diff --git a/Gemfile b/Gemfile
deleted file mode 100644 (file)
index 9281343..0000000
--- a/Gemfile
+++ /dev/null
@@ -1,6 +0,0 @@
-source 'https://rubygems.org'\r
-\r
-gem 'rake', '>= 0'\r
-gem 'rscons', '>= 0'\r
-gem 'rspec', '>= 0'\r
-gem 'trollop', '>= 0'\r
diff --git a/Gemfile.lock b/Gemfile.lock
deleted file mode 100644 (file)
index dbafdb2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-GEM
-  remote: https://rubygems.org/
-  specs:
-    diff-lcs (1.2.5)
-    json (1.8.1)
-    rake (10.3.2)
-    rscons (1.8.1)
-      json (~> 1.0)
-    rspec (3.1.0)
-      rspec-core (~> 3.1.0)
-      rspec-expectations (~> 3.1.0)
-      rspec-mocks (~> 3.1.0)
-    rspec-core (3.1.7)
-      rspec-support (~> 3.1.0)
-    rspec-expectations (3.1.2)
-      diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.1.0)
-    rspec-mocks (3.1.3)
-      rspec-support (~> 3.1.0)
-    rspec-support (3.1.2)
-    trollop (2.0)
-
-PLATFORMS
-  ruby
-  x86-mingw32
-
-DEPENDENCIES
-  rake
-  rscons
-  rspec
-  trollop
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..ee0869b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+#------------------------------------------------------------------------------
+# Build Configuration
+#------------------------------------------------------------------------------
+# Update these variables according to your requirements.
+
+# tools
+CC = c99
+LD = ${CC}
+
+# flags
+INCS      = -Isource/
+CPPFLAGS  = -D_XOPEN_SOURCE=700
+CFLAGS   += ${INCS} ${CPPFLAGS}
+LDFLAGS  += ${LIBS}
+
+#------------------------------------------------------------------------------
+# Build Targets and Rules
+#------------------------------------------------------------------------------
+SRCS = source/main.c    \
+       source/grammar.c \
+       source/lexer.c   \
+       source/parser.c  \
+       source/opts.c    \
+       source/pprint.c  \
+       source/gc.c      \
+       source/vec.c     \
+       source/ast.c
+OBJS = ${SRCS:.c=.o}
+
+all: options sclpl test
+
+options:
+       @echo "Toolchain Configuration:"
+       @echo "  CC       = ${CC}"
+       @echo "  CFLAGS   = ${CFLAGS}"
+       @echo "  LD       = ${LD}"
+       @echo "  LDFLAGS  = ${LDFLAGS}"
+
+sclpl: ${OBJS}
+       @echo LD $@
+       @${LD} ${LDFLAGS} -o $@ ${OBJS}
+
+test: sclpl
+       @echo TEST $<
+       @rspec --pattern 'spec/**{,/*/**}/*_spec.rb'
+
+.c.o:
+       @echo CC $<
+       @${CC} ${CFLAGS} -c -o $@ $<
+
+clean:
+       @rm -f sclpl ${OBJS}
+
+.PHONY: all options test
+
index 27207bde6022a16cee020afb3bf54f1be3f42522..4a7c2317de0623e0a652e3fa2d1599d3919ddcbe 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,10 +1,6 @@
 SCLPL\r
 ==============================================\r
 \r
-    Version:    0.1\r
-    Created By: Michael D. Lowis\r
-    Email:      mike@mdlowis.com\r
-\r
 About This Project\r
 ----------------------------------------------\r
 \r
@@ -14,31 +10,21 @@ Unless explicitly stated otherwise, all code and documentation contained within
 this repository is released under the BSD 2-Clause license. The text for this\r
 license can be found in the LICENSE.md file.\r
 \r
-Requirements For Building\r
+Build Instructions\r
 ----------------------------------------------\r
-The only external dependencies currently required to build this library are as\r
-follows:\r
 \r
-* Chciken Scheme\r
-* SConstruct\r
+## Build and Test the Compiler\r
 \r
-Build Instructions\r
-----------------------------------------------\r
-This project uses SConstruct to build all binaries and libraries. To build the\r
-software simply execute the following command at the root of the project:\r
+Execute the following command to build the compiler executable and run all tests\r
+on it:\r
 \r
-    scons\r
+    make all\r
 \r
-Project Files and Directories\r
-----------------------------------------------\r
+## Build the Compiler and Skip the Tests\r
 \r
-    build/         This is the directory where all output files will be placed.\r
-    source/        The source for the project.\r
-    tests/         Unit test and mock files.\r
-    tools/         Tools required by the build system.\r
-    Doxyfile       Doxygen documentation generator configuration.\r
-    LICENSE.md     The software license notification.\r
-    premake4.lua   A premake4 configuration file for generating build scripts.\r
-    project.vim    A VIM script with project specific configurations.\r
-    README.md      You're reading this file right now!\r
+The test suite for the compiler uses Ruby and Rspec. It is conceivable that an\r
+end user may not have these dependencies installed and may therefore wish to\r
+build the compiler without fully testing it. This may be accomplished by\r
+running the following command:\r
 \r
+    make sclpl\r
diff --git a/build-system b/build-system
deleted file mode 160000 (submodule)
index f1a522b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f1a522b4aed7c58ce3c8467ff8a00f00c3e27e64
diff --git a/build.rb b/build.rb
deleted file mode 100755 (executable)
index ee96dd0..0000000
--- a/build.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env ruby
-require './build-system/setup'
-
-def windows?
-  RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
-end
-
-#------------------------------------------------------------------------------
-# Environment Definitions
-#------------------------------------------------------------------------------
-# Define the default compiler environment
-base_env = BuildEnv.new do |env|
-  # Move the object files to the build dir
-  env.build_dir('source','build/obj/source')
-  env.build_dir('modules','build/obj/modules')
-  # Compiler options
-  env["CFLAGS"] += ['-DLEAK_DETECT_LEVEL=1', '--std=c99', '-Wall', '-Wextra']#, '-Werror']
-  env["CPPPATH"] += Dir['modules/libcds/source/**/'] + [
-    'modules/libopts/source',
-    'source/',
-  ]
-end
-
-# Define the release environment
-main_env = base_env.clone do |env|
-  # Move the object files to the build dir
-  env.build_dir('source','build/obj/source')
-  env.build_dir('modules','build/obj/modules')
-  env["CFLAGS"] += ['-O3']
-end
-
-# Define the test environment
-test_env = base_env.clone do |env|
-  # Move the object files to the build dir
-  env.build_dir('source','build/obj_test/source')
-  env.build_dir('modules','build/obj_test/modules')
-  env['CFLAGS'] +=  ['-O0']
-  if Opts[:profile].include? "coverage"
-    env['CFLAGS']  << '--coverage'
-    env['LDFLAGS'] << '--coverage'
-  end
-end
-
-#------------------------------------------------------------------------------
-# Release Build Targets
-#------------------------------------------------------------------------------
-# Build the compiler
-sources = FileList['source/*.c']
-main_env.Program('build/bin/sclpl', sources)
-
-#------------------------------------------------------------------------------
-# Test Build Targets
-#------------------------------------------------------------------------------
-if Opts[:profile].include? "test"
-  test_env.Program('build/bin/sclpl-test', sources)
-  test_env.Command('RSpec', [], 'CMD' => [
-      'rspec', '--pattern', 'spec/**{,/*/**}/*_spec.rb', '--format', 'documentation'])
-end
index 6913d976e4075c33026c01083bbab23f417eee6c..20f0b847ae8b75438e4f9a07cd97b4a191a4bc26 100644 (file)
@@ -2,7 +2,7 @@ require 'open3'
 
 def cli(options, input = "")
   out, err, status = Open3.capture3(
-      *(['./build/bin/sclpl-test'] + options + [{:stdin_data => input}]))
+      *(['./sclpl'] + options + [{:stdin_data => input}]))
   raise err unless err == ""
   raise "Command returned non-zero status" unless status.success?
   out