getting started

This commit is contained in:
2024-06-25 22:49:14 +09:00
parent 281149feba
commit 03e70af0b4
6 changed files with 110 additions and 0 deletions

33
Makefile Normal file
View 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