summaryrefslogtreecommitdiff
path: root/Makefile
blob: ad30c42a269ad4704d1470846328e61ecf3b3e6e (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
CFLAGS=-std=c99 -g -Wall
LFLAGS=-lSDL2 -lz

OUT=editor
OBJS=main.o     \
     buffer.o   \
     editor.o   \
     error.o    \
     file.o     \
     font.o     \
     input.o    \
     line.o     \
     syntax.o   \
     window.o

DESTDIR=/usr/local

.PHONY: all clean install

all: $(OUT)

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

$(OUT): $(OBJS)
	$(CC) $(LFLAGS) $^ -o $@

clean:
	rm -f $(OBJS) $(OUT)

install:
	mkdir -p $(DESTDIR)/bin/
	cp $(OUT) $(DESTDIR)/bin/