-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
55 lines (41 loc) · 1.01 KB
/
Makefile
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
GIMPTOOL=gimptool-2.0
CC=gcc
CFLAGS+=-pipe -O2 -g -Wall $(shell pkg-config --cflags gtk+-2.0 gtkglext-1.0 gimp-2.0)
LDFLAGS+=
OS=$(shell uname -s)
ifeq (,$(findstring Windows,$(OS)))
EXT=
else
EXT=.exe
endif
TARGET=normalmap$(EXT)
SRCS=normalmap.c preview3d.c scale.c
OBJS=$(SRCS:.c=.o)
LIBS=$(shell pkg-config --libs gtk+-2.0 gtkglext-1.0 gimp-2.0 gimpui-2.0) \
-L/usr/X11R6/lib -lGLEW -lm
ifdef VERBOSE
Q=
else
Q=@
endif
all: $(TARGET)
$(TARGET): $(OBJS)
$(Q)echo "[LD]\t$@"
$(Q)$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
clean:
rm -f *.o $(TARGET)
install: all
$(GIMPTOOL) --install-bin $(TARGET)
.c.o:
$(Q)echo "[CC]\t$<"
$(Q)$(CC) -c $(CFLAGS) -o $@ $<
normalmap.o: normalmap.c scale.h preview3d.h
preview3d.o: preview3d.c scale.h objects/cube.h objects/quad.h \
objects/sphere.h objects/torus.h objects/teapot.h pixmaps/object.xpm \
pixmaps/light.xpm pixmaps/scene.xpm pixmaps/full.xpm
scale.o: scale.c scale.h
ifdef WIN32
-include Makefile.mingw32
else ifdef WIN64
-include Makefile.mingw64
endif