-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
68 lines (56 loc) · 1.73 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
56
57
58
59
60
61
62
63
64
65
66
67
68
CC=gcc
EXECUTABLE=rob.exe
# To be removed later:
#BUILD=debug
# Add your source files here:
SOURCES=src/dom.c src/html.c src/css.c src/style.c \
src/refcnt.c src/refalist.c src/refhash.c \
src/stream.c src/layout.c src/display.c \
src/bmpcanvas.c src/bmp.c \
src/print.c src/main.c
OBJECTS=$(SOURCES:.c=.o)
CFLAGS=-c -Wall
LDFLAGS=
#LDFLAGS=-mwindows
ifeq ($(BUILD),debug)
# Debug
CFLAGS += -O0 -g -I/local/include
LDFLAGS +=
else
# Release mode
CFLAGS += -O2 -DNDEBUG -I/local/include
LDFLAGS += -s
endif
all: $(EXECUTABLE)
@echo Done
debug:
@echo Building Debug version...
@make BUILD=debug
$(EXECUTABLE) : $(OBJECTS)
@echo Linking $@
@$(CC) $(LDFLAGS) -o $@ $^
.c.o:
@echo Compiling $@
@$(CC) $(CFLAGS) $< -o $@
stream.o : stream.c stream.h
dom.o : dom.c dom.h refcnt.h refalist.h refhash.h
html.o : html.c html.h refcnt.h dom.h refalist.h refhash.h stream.h
css.o : css.c css.h refcnt.h refalist.h stream.h
style.o : style.c style.h dom.h css.h refhash.h refcnt.h refalist.h
layout.o : layout.c layout.h refcnt.h refalist.h refhash.h style.h dom.h css.h
display.o : display.c display.h layout.h refcnt.h refalist.h refhash.h style.h dom.h css.h
canvas.o : bmpcanvas.c canvas.h bmp.h display.h layout.h refcnt.h refalist.h refhash.h style.h dom.h css.h
main.o : main.c html.h dom.h refalist.h refhash.h print.h \
stream.h refcnt.h css.h style.h layout.h display.h canvas.h
print.o : print.c print.h html.h dom.h refalist.h refhash.h \
stream.h refcnt.h css.h style.h layout.h display.h
refcnt.o: refcnt.c refcnt.h
refalist.o : refalist.c refalist.h refcnt.h
refhash.o : refhash.c refhash.h refcnt.h
bmp.o : bmp.c bmp.h
.PHONY : clean
clean:
@-rm -f *.o
@-rm -rf $(EXECUTABLE)
@-rm -rf *.log
@echo Cleaned