{"id":22796562,"url":"https://github.com/macmade/makelib","last_synced_at":"2025-04-30T17:24:54.845Z","repository":{"id":26860518,"uuid":"30320610","full_name":"macmade/makelib","owner":"macmade","description":"Generic cross-platform makefile for building C/C++/Objective-C libraries.","archived":false,"fork":false,"pushed_at":"2021-08-02T22:55:19.000Z","size":31,"stargazers_count":13,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T18:15:23.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/macmade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-04T20:53:42.000Z","updated_at":"2024-06-21T05:16:54.000Z","dependencies_parsed_at":"2022-09-01T21:12:22.458Z","dependency_job_id":null,"html_url":"https://github.com/macmade/makelib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fmakelib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fmakelib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fmakelib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2Fmakelib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macmade","download_url":"https://codeload.github.com/macmade/makelib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251749820,"owners_count":21637612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T05:13:36.502Z","updated_at":"2025-04-30T17:24:54.809Z","avatar_url":"https://github.com/macmade.png","language":"Makefile","funding_links":["https://patreon.com/macmade","https://paypal.me/xslabs"],"categories":[],"sub_categories":[],"readme":"makelib\n=======\n\n[![Build Status](https://img.shields.io/travis/macmade/makelib.svg?branch=master\u0026style=flat)](https://travis-ci.org/macmade/makelib)\n[![Issues](http://img.shields.io/github/issues/macmade/makelib.svg?style=flat)](https://github.com/macmade/makelib/issues)\n![Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat)\n![License](https://img.shields.io/badge/license-mit-brightgreen.svg?style=flat)\n[![Contact](https://img.shields.io/badge/contact-@macmade-blue.svg?style=flat)](https://twitter.com/macmade)  \n[![Donate-Patreon](https://img.shields.io/badge/donate-patreon-yellow.svg?style=flat)](https://patreon.com/macmade)\n[![Donate-Gratipay](https://img.shields.io/badge/donate-gratipay-yellow.svg?style=flat)](https://www.gratipay.com/macmade)\n[![Donate-Paypal](https://img.shields.io/badge/donate-paypal-yellow.svg?style=flat)](https://paypal.me/xslabs)\n\nAbout\n-----\n\nmakelib is a generic cross-platform makefile for building C/C++/Objective-C libraries.  \nIts purpose is to ease the build process of libraries for cross-platform projects.\n\n### Available targets by system\n\nBuilding on **OSX**, the following files will be produced:\n\n  - **Static library** (`.a`): `i386` `x86_64` `armv7` `armv7s` `arm64`\n  - **Dynamic library** (`.dylib`): `i386` `x86_64`\n  - **Mac framework** (`.framework`): `i386` `x86_64`\n\nOn **Linux**:\n\n  - **Static library** (`.a`): host architecture\n  - **Dynamic library** (`.so`): host architecture\n\nNote that on OS X builds, ARM libraries are obviously targeted for iOS.\n\nConfiguration\n-------------\n\n### Recommended project structure\n\nYou may use `makelib` as a submodule of your project.\n\nYou'll need a **build** directory with a specific structure, a directory with **sources**, a directory with **includes** and finally a **Makefile** with configuration options.\n\nHere's an example project structure:\n\n    Build/                    (Build directory)\n        Debug/                (Files produced by \"debug\" builds)\n            Intermediates/    (Debug intermediate object files by architecture)\n            Products/         (Debug products by architecture)\n        Release/              (Files produced by \"release\" builds)\n            Intermediates/    (Release intermediate object files by architecture)\n            Products/         (Release products by architecture)\n    Makefile                  (Makefile with makelib configuration values)\n    makelib/                  (makelib submodule)\n    MyProject/                (Project directory)\n        include/              (Directory with include files)\n        Info.plist            (Info.plist file - Required for building a Mac framework)\n        source/               (Directory with source files)\n        tests/                (Directory with unit test files, if any)\n\n### Configuration Makefile\n\nA makefile containing configuration values for makelib is required.  \nAssuming the previous project structure and a C++ project, this makefile may look like:\n    \n    BUILD_LEGACY_ARCHS  := 0\n    \n    include makelib/Common.mk\n    \n    PRODUCT             := MyProject\n    PRODUCT_LIB         := libMyProject\n    PRODUCT_DYLIB       := libMyProject\n    PRODUCT_FRAMEWORK   := MyProject\n    PREFIX_DYLIB        := /usr/local/lib/\n    PREFIX_FRAMEWORK    := /Library/Frameworks/\n    DIR_INC             := MyProject/include/\n    DIR_SRC             := MyProject/source/\n    DIR_RES             := MyProject/\n    DIR_TESTS           := MyProject/tests\n    EXT_C               := .c\n    EXT_CPP             := .cpp\n    EXT_M               := .m\n    EXT_MM              := .mm\n    EXT_H               := .h\n    FILES               := $(call GET_CPP_FILES, $(DIR_SRC))\n    FILES_TESTS         := $(call GET_CPP_FILES, $(DIR_TESTS))\n    CC                  := clang\n    LIBS                := \n    FLAGS_OPTIM         := -Os\n    FLAGS_WARN          := -Wall -Werror\n    FLAGS_STD_C         := c99\n    FLAGS_STD_CPP       := c++11\n    FLAGS_OTHER         := \n    FLAGS_C             := \n    FLAGS_CPP           := \n    FLAGS_M             := -fobjc-arc\n    FLAGS_MM            := -fobjc-arc\n    \n    include makelib/Targets.mk \n\nPlease read the section below for details about each configuration value.\n\n#### Configuration values\n\n**PRODUCT**  \nThe name of your product/project.\n\n**PRODUCT_LIB**  \nThe name for the generated static library.  \nNote: always use a `lib` prefix.\n\n**PRODUCT_DYLIB**  \nThe name for the generated dynamic library.  \nNote: always use a `lib` prefix.\n\n**PRODUCT_FRAMEWORK**  \nThe name for the generated Mac framework package.\n\n**PREFIX_DYLIB**  \nThe directory in which the dynamic library is intended to be installed.\n\n**PREFIX_FRAMEWORK**  \nThe directory in which the Mac framework is intended to be installed.\n\n**DIR_INC**  \nThe directory with include files.\n\n**DIR_SRC**  \nThe directory with source files.\n\n**DIR_RES**  \nThe directory with resource files, link `Info.plist`.\n\n**DIR_TESTS**  \nThe directory with unit test files, if any.\n\n**EXT_C**  \nThe file extension for your C source files (typically `.c`).\n\n**EXT_CPP**  \nThe file extension for your C++ source files (typically `.cpp`).\n\n**EXT_M**  \nThe file extension for your Objective-C source files (typically `.m`).\n\n**EXT_MM**  \nThe file extension for your Objective-C++ source files (typically `.mm`).\n\n**EXT_H**  \nThe file extension for your header files (`.h`, `.hpp`, etc).\n\n**FILES**  \nThe project files to compile.  \nNote that you can use the `GET_C_FILES` function for convenience:\n\n    FILES := $(call GET_C_FILES, some/dir/) $(call GET_C_FILES, some/other/dir/)\n\n**FILES_TESTS**  \nThe unit test files to compile.\nNote that you can use the `GET_C_FILES` function for convenience:\n\n    FILES := $(call GET_C_FILES, some/dir/) $(call GET_C_FILES, some/other/dir/)\n\n**CC**  \nThe compiler to use (`clang`, `gcc`, `g++`, etc).\n\n**LIBS**  \nAny libraries to link with when building the project.  \nEg: `-lpthread -lz -lc++`\n\n**FLAGS_OPTIM**  \nOptimisation flags for the compiler (`Os`, `O3`, etc).\n\n**FLAGS_WARN**  \nWarning flags for the compiler.  \nEg: `-Wall -Werror -Wpedantic`\n\n**FLAGS_STD_C**  \nThe C language standard to use (`c99`, `c11`, etc).\n\n**FLAGS_STD_CPP**  \nThe C++ language standard to use (`c++11`, `c++14`, etc).\n\n**FLAGS_OTHER**  \nAny other flags to pass to the compiler.\n\n**FLAGS_C**  \nSpecific flags for the C compiler.\n\n**FLAGS_CPP**  \nSpecific flags for the C++ compiler.\n\n**FLAGS_M**  \nSpecific flags for the Objective-C compiler.\n\n**FLAGS_MM**  \nSpecific flags for the Objective-C++ compiler.\n\n**BUILD_LEGACY_ARCHS**\nBuilds legacy architectures (eg. i386 on macOS).  \nNote: define it before including `Common.mk`\n\nDemo / Example\n--------------\n\nYou'll find a working example C project in the `Demo` subdirectory.\n\nLicense\n-------\n\nmakelib is released under the terms of the MIT license.\n\nRepository Infos\n----------------\n\n    Owner:\t\t\tJean-David Gadina - XS-Labs\n    Web:\t\t\twww.xs-labs.com\n    Blog:\t\t\twww.noxeos.com\n    Twitter:\t\t@macmade\n    GitHub:\t\t\tgithub.com/macmade\n    LinkedIn:\t\tch.linkedin.com/in/macmade/\n    StackOverflow:\tstackoverflow.com/users/182676/macmade\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacmade%2Fmakelib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacmade%2Fmakelib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacmade%2Fmakelib/lists"}