https://github.com/andreas-schwenk/makemake
Simple Makefile generator for C projects, written in Python
https://github.com/andreas-schwenk/makemake
makefile-generation python3 python3-package
Last synced: 30 days ago
JSON representation
Simple Makefile generator for C projects, written in Python
- Host: GitHub
- URL: https://github.com/andreas-schwenk/makemake
- Owner: andreas-schwenk
- License: gpl-3.0
- Created: 2023-03-19T08:26:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-19T10:34:58.000Z (almost 3 years ago)
- Last Synced: 2025-09-28T12:28:12.327Z (5 months ago)
- Topics: makefile-generation, python3, python3-package
- Language: Python
- Homepage: https://pypi.org/project/makemake/
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# makemake
`makemake` is a simple Makefile generator for C projects.
## Example
Example input file `Makefile.in`:
```makefile
PROG=prog # the program name
DIR=src/ # the source code directory
STD=c99 # the C standard
BUILD=build/ # the output directory
```
Assume we have the following project files:
```
src/config.h
src/lex.h
src/lex.c
src/main.c
```
Then the output `Makefile` is as follows:
```makefile
# Makefile generated by makemake - by Andreas Schwenk
PROG=prog
CC=gcc -std=c99
BUILD_DIR=build/
INC=
LIB=
CFLAGS=$(FLAGS)
HEADERS=src/config.h src/lex.h
OBJS=$(BUILD_DIR)lex.o $(BUILD_DIR)main.o
$(shell mkdir -p $(BUILD_DIR))
all: $(PROG)
clean:
rm -rf $(BUILD_DIR)
$(PROG): $(OBJS)
$(CC) $(OBJS) $(INC) $(CFLAGS) $(LIB) -o $(BUILD_DIR)$(PROG)
$(BUILD_DIR)lex.o: src/lex.c $(HEADERS)
$(CC) src/lex.c $(INC) $(CFLAGS) -c -o $(BUILD_DIR)lex.o
$(BUILD_DIR)main.o: src/main.c $(HEADERS)
$(CC) src/main.c $(INC) $(CFLAGS) -c -o $(BUILD_DIR)main.o
```
## Usage
### Installation
```bash
pip install makemake
```
### Command Line
```bash
makemake 'Makefile.in'
```
### API
```python
import makemake
# creates output 'Makefile' using meta data specified
# in 'Makefile.in'
makemake.makemake('Makefile.in', 'Makefile')
```