]> git.sur5r.net Git - cc65/blob - src/sp65/make/gcc.mak
22873cadc7045468989413dbf18fc5d2bbb1677b
[cc65] / src / sp65 / make / gcc.mak
1 #
2 # Makefile for the sp65 sprite and bitmap utility utility
3 #
4
5
6 # ------------------------------------------------------------------------------
7
8 # The executable to build
9 EXE     = sp65
10
11 # Library dir
12 COMMON  = ../common
13
14 #
15 CC      = gcc
16 CFLAGS  = -O2 -g -Wall -W -std=c89
17 override CFLAGS += -I$(COMMON)
18 EBIND   = emxbind
19 LDFLAGS =
20
21
22 # -----------------------------------------------------------------------------
23 # List of all object files
24
25 OBJS =  asm.o           \
26         bin.o           \
27         bitmap.o        \
28         color.o         \
29         error.o         \
30         fileio.o        \
31         input.o         \
32         main.o          \
33         output.o        \
34         palette.o       \
35         pcx.o
36
37 LIBS = $(COMMON)/common.a
38
39 # ------------------------------------------------------------------------------
40 # Makefile targets
41
42 # Main target - must be first
43 .PHONY: all
44 ifeq (.depend,$(wildcard .depend))
45 all:    $(EXE)
46 include .depend
47 else
48 all:    depend
49         @$(MAKE) -f make/gcc.mak all
50 endif
51
52 $(EXE): $(OBJS) $(LIBS)
53         $(CC) $(LDFLAGS) $^ -o $@
54         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
55
56 clean:
57         $(RM) *~ core.* *.map
58
59 zap:    clean
60         $(RM) *.o $(EXE) .depend
61
62 # ------------------------------------------------------------------------------
63 # Make the dependencies
64
65 .PHONY: depend dep
66 depend dep:     $(OBJS:.o=.c)
67         @echo "Creating dependency information"
68         $(CC) $(CFLAGS) -MM $^ > .depend
69
70
71