summaryrefslogtreecommitdiff
path: root/Makefile
blob: 683aecfc3a32b131005dc4feceb51f3a24c4c13e (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
##
## Makefile for  in /home/gayot_o/prog/lib/sdl-digit
## 
## Made by olivier gayot
## Login   <gayot_o@epitech.net>
## 
## Started on  Mon Apr 23 04:13:10 2012 olivier gayot
## Last update Mon Apr 23 04:13:10 2012 olivier gayot
##

CC		?=	gcc
CFLAGS		+=	-W -Wall -pedantic -std=c99 -Wextra -O3 `sdl-config --cflags`
CFLAGS		+=	-I./include
HEADERS		=	include/sdl_digit.h
LDFLAGS		+=	`sdl-config --libs` -lm
LDFLAGS		+=	-L./lib
SRC_DIR		=	src

SRC		=	line.c		\
			bar.c		\
			rect.c		\
			pixel.c		\
			digit.c		\
			string.c
SRC		:=	$(addprefix $(SRC_DIR)/, $(SRC))
OBJ		=	$(SRC:.c=.o)
NAME		=	libsdl-digit.a
DEBUG		=	-g
RENDU		=	-D PRAG

all: $(NAME)

$(NAME): $(OBJ)
	@echo 'Creating archive $(NAME)'
	@$(AR) $(ARFLAGS) $(NAME) $(OBJ)
	@echo 'done.'
	@echo 'Generating index for $(NAME)'
	@ranlib $(NAME)
	@echo 'done.'

clean:
	@echo 'Cleaning obj files'
	@$(RM) $(OBJ)
	@echo 'done.'

fclean: clean
	@echo 'Cleaning $(NAME)'
	@$(RM) $(NAME)
	@echo 'done'

re: fclean all

install:
	@echo '######## Installing $(basename $(NAME)) ########'
	cp $(NAME) /usr/lib/
	cp $(HEADERS) /usr/include/sdl-digit/

debug: CFLAGS += $(DEBUG)
debug: re