File: Makefile

package info (click to toggle)
dmagnetic 0.30-1
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 664 kB
  • sloc: ansic: 9,066; makefile: 78; sh: 35
file content (116 lines) | stat: -rw-r--r-- 3,656 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
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/make -f 
#
#Copyright 2021, dettus@dettus.net
#
#Redistribution and use in source and binary forms, with or without modification,
#are permitted provided that the following conditions are met:
#
#1. Redistributions of source code must retain the above copyright notice, this 
#   list of conditions and the following disclaimer.
#
#2. Redistributions in binary form must reproduce the above copyright notice, 
#   this list of conditions and the following disclaimer in the documentation 
#   and/or other materials provided with the distribution.
#
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
#FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
#DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
#SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
#OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

DESTDIR?=/usr/local
INSTALLBIN=$(DESTDIR)/bin
INSTALLSHARE=$(DESTDIR)/share/games
INSTALLMAN=$(DESTDIR)/share/man

CC?=gcc
AR?=ar
#CFLAGS=-g -O0
CFLAGS?=-O3
CFLAGS+=-Wall
#CFLAGS+=-Werror
PROJ_HOME=./
INCFLAGS=-I$(PROJ_HOME)src/gui -I$(PROJ_HOME)src/toplevel -I$(PROJ_HOME)src/loader -I$(PROJ_HOME)src/engine/vm68k -I$(PROJ_HOME)src/engine/linea -I$(PROJ_HOME)src/engine/include 
OBJDIR=$(PROJ_HOME)obj/
LINK=$(CC)
LDFLAGS+="-L"$(OBJDIR)

SOURCES_LOADER=	\
	src/loader/loader_common.c	\
	src/loader/loader_msdos.c	\
	src/loader/loader_mw.c		\
	src/loader/loader_d64.c		\
	src/loader/loader_dsk.c		\
	src/loader/loader_archimedes.c	\
	src/loader/loader_atarixl.c	\
	src/loader/maggfxloader.c

SOURCES_LINEA=	\
	src/engine/linea/gfx1loader.c	\
	src/engine/linea/gfx2loader.c	\
	src/engine/linea/linea.c

SOURCES_VM68K=	\
	src/engine/vm68k/vm68k.c	\
	src/engine/vm68k/vm68k_decode.c	\
	src/engine/vm68k/vm68k_loadstore.c

SOURCES_GUI=	\
	src/gui/default_callbacks.c	\
	src/gui/default_palette.c	\
	src/gui/default_render.c

SOURCES_TOPLEVEL=	\
	src/toplevel/configuration.c	\
	src/toplevel/dMagnetic_helpscreens.c	\
	src/toplevel/dMagnetic.c

OBJ_LOADER=${SOURCES_LOADER:.c=.o}
OBJ_LINEA=${SOURCES_LINEA:.c=.o}
OBJ_VM68K=${SOURCES_VM68K:.c=.o}
OBJ_GUI=${SOURCES_GUI:.c=.o}
OBJ_TOPLEVEL=${SOURCES_TOPLEVEL:.c=.o}

all:	dMagnetic dMagnetic.ini
#	#strip dMagnetic

clean:
	rm -rf dMagnetic dMagnetic.ini
	rm -rf $(OBJ_LOADER)
	rm -rf $(OBJ_LINEA)
	rm -rf $(OBJ_VM68K)
	rm -rf $(OBJ_GUI)
	rm -rf $(OBJ_TOPLEVEL)

install: all dMagnetic.1 dMagneticini.5
	mkdir -p $(INSTALLBIN)
	mkdir -p $(INSTALLMAN)/man1
	mkdir -p $(INSTALLMAN)/man5
	mkdir -p $(INSTALLSHARE)/dMagnetic

	cp dMagnetic $(INSTALLBIN)
	cp dMagnetic.1 $(INSTALLMAN)/man1
	cp dMagneticini.5 $(INSTALLMAN)/man5
	#cp README.txt $(INSTALLSHARE)/dMagnetic
	#cp LICENSE.txt $(INSTALLSHARE)/dMagnetic
	cp dMagnetic.ini $(INSTALLSHARE)/dMagnetic


dMagnetic:	$(OBJ_LOADER) $(OBJ_LINEA) $(OBJ_VM68K) $(OBJ_GUI) $(OBJ_TOPLEVEL)
	$(LINK) $(LDFLAGS) -o $@ $(OBJ_LOADER) $(OBJ_LINEA) $(OBJ_VM68K) $(OBJ_GUI) $(OBJ_TOPLEVEL)

dMagnetic.ini:	dMagnetic
	./dMagnetic -helpini >dMagnetic.ini

.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_EXTRA) $(INCFLAGS) -c -o $@ $<


## in case some post-compilation checks are needed
## if not, please comment out this line
include ./checks.mk