summaryrefslogtreecommitdiff
path: root/hp41cx-emulator/Makefile
blob: 03cea0d68182f271b096c50074d25bbd4f8e2474 (plain)
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
# Makefile for NSIM package
#
# $Id: Makefile 68 2005-04-23 00:34:21Z eric $
# Copyright 1995, 2003 Eric Smith <eric@brouhaha.com>
# 
# 17.08.2014 add Qt Gui files and splitup into 
# generic libnsim.a
# nsim the X11 Gui application and
# qtnsim the Qt Gui application
#
# NSIM is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2 as published by the Free
# Software Foundation.  Note that I am not granting permission to redistribute
# or modify NSIM under the terms of any later version of the General Public
# License.
# 
# This program is distributed in the hope that it will be useful (or at
# least amusing), but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program (in the file "COPYING"); if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


# -----------------------------------------------------------------------------
# You may need to change the following definitions.  In particular you will
# need to remove the -DUSE_TIMER if you don't have the setitimer() system
# call, and you may need to chage X11LIBS and X11INCS if X isn't in /usr/X11.
# -----------------------------------------------------------------------------
X11LIBS = -L/usr/X11R6/lib -lX11 
X11INCS = -I/usr/X11R6/include
X11SRCS = xio.cpp
X11OBJS = $(addprefix $(OBJDIR)/,$(X11SRCS:.cpp=.o))

AR = ar
CC = gcc
CXXFLAGS = -g -O0 -Wall -std=gnu++11 -DWARNING_G $(X11INCS) 
#-DUSE_TIMER -DAUTO_POWER_OFF
# -----------------------------------------------------------------------------
# You shouldn't have to change anything below this point, but if you do please
# let me know why so I can improve this Makefile.
# -----------------------------------------------------------------------------

VERSION = 0.62

PROGRAMS = nsim qtnsim 

HEADERS = nsim.h hprom.h hplcd.h phineas.h xio.h hprom.h hpram.h ifpf.h
LIBSRCS = nsim.cpp hprom.cpp hplcd.cpp phineas.cpp  ifpf.cpp hpram.cpp
MISC = COPYING README NEWS hp41_rom # CHANGELOG

OBJDIR  = obj

LIBOBJS = $(addprefix $(OBJDIR)/,$(LIBSRCS:.cpp=.o))

SOURCES = $(LIBSRCS) $(X11SRCS)
OBJECTS = $(LIBOBJS) $(X11OBJS)
DEPENDS = $(addprefix $(OBJDIR)/,$(SOURCES:.cpp=.d))

LIBS =  -lstdc++

DISTFILES = $(MISC) Makefile $(HEADERS) $(SOURCES)
PACKAGE = nsim
DSTNAME = $(PACKAGE)-$(VERSION)

all: libnsim.a $(PROGRAMS)

$(OBJDIR):
	-mkdir $@

qtnsim: libnsim.a 
	make -C ./Qtnsim ../$@ 
	
libnsim.a: 	$(LIBOBJS) 
	$(AR)  rcs libnsim.a  $(LIBOBJS)
	
nsim:	$(X11OBJS) libnsim.a Makefile 
	$(CC) -o $@ $(X11OBJS) libnsim.a $(X11LIBS) $(LIBS)


$(OBJDIR)/%.o:%.cpp
	$(CC) -c $(CXXFLAGS) -MMD -MP -MF"$(@:%.o=%.d)" -o $@ $<

dist: $(DISTFILES)
	-rm -rf $(DSTNAME)
	mkdir $(DSTNAME)
	for f in $(DISTFILES); do ln $$f $(DSTNAME)/$$f; done
	tar --gzip -chf $(DSTNAME).tar.gz $(DSTNAME)
	-rm -rf $(DSTNAME)

clean:
	rm -f $(PROGRAMS) $(OBJECTS) $(X11OBJS) $(DEPENDS) libnsim.a 
	make -C Qtnsim clean

-include $(DEPENDS)