getting started
This commit is contained in:
33
Makefile
Normal file
33
Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
NAME=calculator-c-ncurses
|
||||
VERSION=0.0.1
|
||||
|
||||
CC=gcc
|
||||
AR=ar
|
||||
RM=rm -f
|
||||
CFLAGS=-Wall -Wextra -Wmissing-declarations -Wshadow -O2
|
||||
INC=-I./include
|
||||
LIBS=-lncurses
|
||||
|
||||
CALC_S=./src/main.c ./src/calculate.c
|
||||
CALC_O=$(CALC_S:%.c=%.o)
|
||||
CALC_T=calculator-c-ncurses
|
||||
|
||||
.PHONY: all
|
||||
|
||||
all: prepare $(CALC_T)
|
||||
|
||||
$(CALC_T): $(CALC_O)
|
||||
$(CC) $(INC) $(LIBS) -o ./build/$@ $^
|
||||
.c.o:
|
||||
@echo $<
|
||||
$(CC) $(CFLAGS) $(LIBS) $(INC) -c $< -o $@
|
||||
|
||||
$(CALC_O): $(CALC_S)
|
||||
|
||||
prepare:
|
||||
mkdir -p ./build/
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
$(RM) ./src/*.o
|
||||
Reference in New Issue
Block a user