Skip to content

Instantly share code, notes, and snippets.

@tomas-stefano
Created November 16, 2010 20:11
Show Gist options
  • Select an option

  • Save tomas-stefano/702411 to your computer and use it in GitHub Desktop.

Select an option

Save tomas-stefano/702411 to your computer and use it in GitHub Desktop.
Extconf from relation library
require 'mkmf'
extension_name = 'relation_table'
dir_config(extension_name)
# Source files with header and *.c and *.o files
#
RELATION_HEADER_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', 'source'))
RELATION_HEADER_FLAG = "-I #{RELATION_HEADER_PATH}"
# HERE IS THE WAY I DO IT AFTER READING THE SOUrCE CODE OF MKMF
#
$objs = Dir["*.o", "#{RELATION_HEADER_PATH}/*.o", "#{RELATION_HEADER_PATH}/*/*.o"]
with_cflags(RELATION_HEADER_FLAG) do
create_makefile(extension_name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment