summaryrefslogtreecommitdiffstats
path: root/src/Makefile
blob: 6f4ed9a2a9095e28b6151c449b810acd852ab9ed (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
CC	= cc
CFLAGS	= -g -Wall -O2
LDFLAGS	=
HEADERS	= charset.h basic.h hexdump.h
OBJS	= charset.o basic.o hexdump.o main.o
NAME	= zxdump

PREFIX	= /usr/local
INSTALL	= /usr/bin/install
RM	= /bin/rm

INCLUDE_PATH	= ../include
HEADERS_SUBDIR	= zx
HEADERS_BUILD	= $(addprefix $(INCLUDE_PATH)/$(HEADERS_SUBDIR)/, $(HEADERS))

all: $(NAME)

$(NAME): $(OBJS)
	$(CC) $(OBJS) -o $(NAME) $(LDFLAGS)

$(OBJS): %.o: %.c $(HEADERS_BUILD)
	$(CC) $(CFLAGS) -I$(INCLUDE_PATH) -c $<

install: $(NAME)
	$(INSTALL) -c -m 0755 $(NAME) $(PREFIX)/bin

clean:
	$(RM) -f $(NAME) $(OBJS)