main: need polish, almost done
This commit is contained in:
commit
8a6ffdedb1
4 changed files with 206 additions and 0 deletions
34
Makefile
Normal file
34
Makefile
Normal file
|
@ -0,0 +1,34 @@
|
|||
.PHONY: all test clean build
|
||||
|
||||
SRC = src/main.c
|
||||
OJB = $(SRC:.c=.o)
|
||||
OUT = build
|
||||
|
||||
CC = /usr/bin/gcc
|
||||
CFLAGS = -ansi -Wall -std=c99 -O0
|
||||
CFDEBUG = -ansi -Wall -g -std=c99
|
||||
RM = /bin/rm -fr
|
||||
TEST = -D TEST_TECH
|
||||
PART = -D PART_
|
||||
EVE = -D EVE_
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS)
|
||||
|
||||
build:
|
||||
$(CC) $(SRC) $(PART)$(part) $(EVE)$(eve) $(CFLAGS) -o $(OUT)/main.o
|
||||
|
||||
build_test:
|
||||
$(CC) $(SRC) $(CFLAGS) $(TEST) -o $(OUT)/main.o
|
||||
|
||||
debug:
|
||||
$(CC) $(SRC) $(PART)$(part) $(CFDEBUG) -o $(OUT)/main.o
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJ) $(OUT)/main.o
|
||||
|
||||
run:
|
||||
$(MAKE) build && ./build/main.o
|
||||
|
||||
test:
|
||||
$(MAKE) build_test && ./build/main.o
|
Loading…
Add table
Add a link
Reference in a new issue