Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9223605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:06:48+00:00 2026-06-18T04:06:48+00:00

Context: I have downloaded the source code for Discount, which is a simple C

  • 0

Context:

I have downloaded the source code for “Discount”, which is a simple C program. The code is online here: http://www.pell.portland.or.us/~orc/Code/discount/

What I Need:

I want to turn this code into a .dylib file that I can then bundle with my Cocoa app. Once I HAVE the dylib file, I’m fine. What I’m struggling with is how to CREATE the dylib file in the first place.

Before you yell at me, YES I have Googled my ass off. But I cannot find a straightforward explanation of exactly what I need to do at the command line to compile this collection of C source files into a .dylib. Everything I come across is convoluted or talks about building a dylib project in Xcode or is outdated. (I’ve found some references for doing it with GCC, but I’d like to use LLVM.)

Make Install

From what I gather, running the typical “make install” is supposed to put a .dylib file into /usr/lib, but that does not seem to be happening for me.

Bottom Line:

Once I’ve downloaded the Discount source code, what do I need to do at the command line to create a .dylib file on OS X 10.8.2? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:06:49+00:00Added an answer on June 18, 2026 at 4:06 am

    That project by default doesn’t create a dynamic library on Mac OS X. I made a quick patch to the makefile that seems to work:

    From a3d6793c5f291d253b8e7aa99e5534503808c325 Mon Sep 17 00:00:00 2001
    From: Carl Norum <carl@norum.ca>
    Date: Thu, 31 Jan 2013 16:59:24 -0800
    Subject: [PATCH] Patch to generate a dynamic library.
    
    ---
     Makefile | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/Makefile b/Makefile
    index 8532e70..11805dd 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -27,6 +27,7 @@ install: $(PGMS) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCDIR)
        /usr/bin/install -s -m 755 $(PGMS) $(DESTDIR)$(BINDIR)
        ./librarian.sh install libmarkdown VERSION $(DESTDIR)$(LIBDIR)
        /usr/bin/install -m 444 mkdio.h $(DESTDIR)$(INCDIR)
    +   /usr/bin/install -m 755 $(MKDLIB).dylib $(DESTDIR)$(LIBDIR)
    
     install.everything: install install.samples install.man
    
    @@ -82,7 +83,7 @@ theme:  theme.o $(MKDLIB) mkdio.h
     mkd2html:  mkd2html.o $(MKDLIB) mkdio.h
        $(CC) $(LFLAGS) -o mkd2html mkd2html.o -lmarkdown 
    
    -markdown: main.o pgm_options.o $(MKDLIB)
    +markdown: main.o pgm_options.o $(MKDLIB) $(MKDLIB).dylib
        $(CC) $(LFLAGS) -o markdown main.o pgm_options.o -lmarkdown 
    
     makepage:  makepage.c pgm_options.o $(MKDLIB) mkdio.h
    @@ -94,6 +95,9 @@ pgm_options.o: pgm_options.c mkdio.h config.h
     main.o: main.c mkdio.h config.h
        $(CC) -I. -c main.c
    
    +$(MKDLIB).dylib: $(OBJS)
    +   $(CC) -dynamiclib -o $(MKDLIB).dylib $(OBJS)
    +
     $(MKDLIB): $(OBJS)
        ./librarian.sh make $(MKDLIB) VERSION $(OBJS)
    
    -- 
    1.7.12.1
    

    You can apply that to your tree after running the configure script and before building and it should work out. If you just want the easy part, running:

    cc -Wno-implicit-int -I. -dynamiclib -o libmarkdown.dylib mkdio.o markdown.o dumptree.o generate.o resource.o docheader.o version.o toc.o css.o xml.o Csio.o xmlpage.o basename.o emmatch.o github_flavoured.o setup.o tags.o html5.o flags.o 
    

    on your command line after building the regular package should generate the dynamic library for you. You can then install it yoursef.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is
I have downloaded the source of GMP library 5.02, and - as suggested here
Context I have this piece of Java Code btn.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent
I have downloaded and used Kendo UI with Kendo UI grids, but my source
So I have download the source code successfully, built it successfully, and can run
I am trying to download a source code file from a web site which
I have download sample tablelayout source code it's working fine. I am trying to
I have this content script that downloads some binary data using XHR, which is
Context I have a live running redis-server. I want to make a backup. Idea:
Context We have a SharePoint site set up on a Windows Server 2008 VM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.