aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/Makefile.template
blob: 974987a0a0449c278aa44949f26ec101bfb260d1 (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
# src/glsl/Makefile.template

# Template makefile for glsl libraries.
#
# Usage:
#   The minimum that the including makefile needs to define
#   is TOP, LIBNAME and one of of the *_SOURCES.
#
# Optional defines:
#   LIBRARY_INCLUDES are appended to the list of includes directories.
#   LIBRARY_DEFINES is not used for makedepend, but for compilation.


### Basic defines ###

OBJECTS = $(C_SOURCES:.c=.o)

INCLUDES = \
	-I. \
	$(LIBRARY_INCLUDES)


##### TARGETS #####

default: depend lib$(LIBNAME).a

lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template
	$(MKLIB) -o $(LIBNAME) -static $(OBJECTS)

depend: $(C_SOURCES)
	rm -f depend
	touch depend
	$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) 2> /dev/null

# Remove .o and backup files
clean:
	rm -f $(OBJECTS) lib$(LIBNAME).a depend depend.bak

# Dummy target
install:
	@echo -n ""


##### RULES #####

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

-include depend