File: makefile.cyg

package info (click to toggle)
smapi 2.4.0%2Brc2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 1,016 kB
  • ctags: 1,831
  • sloc: ansic: 11,304; pascal: 394; makefile: 137; asm: 125
file content (104 lines) | stat: -rw-r--r-- 2,318 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# $Id: makefile.cyg,v 1.12 2003/02/01 22:14:50 stas_degteff Exp $
# Makefile for Building SMAPI with Mingw32 for NT.
# No support for the Husky build environment.

# Uncomment this for compile info for gdb and display more compiler warnings
DEBUG	= -g -pedantic

# Uncomment this for strip all simbols from binaries to reduce file sizes
#STRIP	= -s


## programs ##

#use this line if you are using MINGW32 on a Windows box
GCC	= gcc
AR	= ar
RANLIB	= ranlib

#use this line if you are using MINGW32 CPD on a Unix box as cross compiler
#CC	= i386-mingw32-gcc
#AR	= i386-mingw32-ar
#RANLIB	= i386-mingw32-ranlib
RM	= rm

## file suffixes ##

C	= .c
OBJ	= .o
LIB	= .a
EXE	= .exe
DLL	= .dll

## program options ##

# compiler defines
CDEFS	=
# common compiler options
CFLAGS	= -Wall -mno-cygwin -O3
# options for compile only (link is off)
OBJOPT	= -c
# options for build static library
LIBOPT	= -static
# options for build dll
DLLOPT  = -shared
# option for specify output file name
NAMEOPT	= -o
# options for $(AR) program
ARFLAGS	= rs

## files ##
TARGET	= libsmapicyg$(LIB)
DLLTARGET= smapi$(DLL)
# libraries need to build binary file
LIBS	=

## other, usualy not modify below ##
CYGWIN_VERSION	= $(shell uname -r)

ifeq ( , $(findstring "1.3.9", $(CYGWIN_VERSION)) )
ifeq ( , $(findstring "1.3.10", $(CYGWIN_VERSION)) )
ifeq ( , $(findstring "1.3.11", $(CYGWIN_VERSION)) )
 # new cygwin require library mingwex for build with '-mno-cygwin' option
LIBS	+= -lmingwex
endif
endif
endif

CFLAGS	+= $(DEBUG)

.PHONY:	distclean clean all static dll programs default

include makefile.inc

default:
	@echo Run 'make dll' to build dll version \($(DLLTARGET), $(PROGRAMS)\)
	@echo Run 'make static' to build static version \($(TARGET), $(PROGRAMS)\)
	@echo Run 'make programs' to build static version of programs \($(PROGRAMS)\)
	@echo Run 'make all' to build all above

all:	static dll programs

static:	$(TARGET)
dll:	$(DLLTARGET)
programs:  $(PROGRAMS)

%.exe:	%.c $(TARGET)
	$(CC) $(STRIP) $(CFLAGS) $(CDEFS) $(NAMEOPT)$@ $^ $(LIBS)

.c.o:
	$(CC) $(CFLAGS) $(CDEFS) $(OBJOPT) $<

$(TARGET):	$(OBJS)
	$(AR) $(ARFLAGS) $(TARGET) $?
#	$(RANLIB) $(TARGET)   # 'ar rs' doing this
	
$(DLLTARGET):	$(OBJS)
	$(CC) $(DLLOPT) $(CFLAGS) $(NAMEOPT)$@ $^


clean:
	-$(RM) *$(OBJ)

distclean:
	-$(RM) $(DLLTARGET) $(TARGET) $(PROGRAMS)