aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: dee2c36a1882ad2b1f984c19f0c9bcf7a7c906c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CC      = /usr/bin/gcc
CFLAGS  = -Wall -g
LDFLAGS = -lm
OUTPUT = bitmap
BUILDDIR = build

FILE = a

OBJ = main.o

build: $(OBJ)
	mkdir -p $(BUILDDIR)
	$(CC) $(CFLAGS) -o $(BUILDDIR)/$(OUTPUT) $(OBJ) $(LDFLAGS)

debug: build
	gdb $(BUILDDIR)/$(OUTPUT) a.bmp

%.o: %.c
	@echo
	@echo Building $<
	@echo ==============
	@echo
	$(CC) $(CFLAGS) -c $<

all: clean build

.PHONY: clean

clean:
	rm -df  $(OBJ)
	rm -Rdf $(BUILDDIR)

run: build
	$(BUILDDIR)/$(OUTPUT) $(FILE).bmp $(FILE).txt