Subversion Repositories WindowManager

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 gdshaw@RISCPKG.ORG 1
# This file is part of the free Window Manager module.
2
# Copyright  2007 Graham Shaw.
3
# Redistribution and modification are permitted within the terms of the
4
# GNU General Public License (version 2 or any later version).
5
 
6
AS = as
7
CC = gcc
8
CXX = g++
9
LD = g++
10
CMHG = cmunge
11
FIXDEPS = fixdeps
12
 
13
CPPFLAGS = -IOSLib:
14
CFLAGS = -mthrowback -mlibscl -mmodule -O2 \
15
 -Wall -W -Wno-unused -Wno-uninitialized
16
CXXFLAGS = -mthrowback -mlibscl -mmodule -fno-exceptions -O2 \
17
 -Wall -W -Wno-unused -Wno-uninitialized
18
ASFLAGS = -throwback -objasm -module -apcs32 -apcsfpv3 -target xscale -IOSLib:
19
LDFLAGS = -mlibscl -mmodule
20
CMHGFLAGS = -zoslib -zbase -tgcc -32bit
21
 
22
%.o: %.s
23
	$(AS) $(ASFLAGS) -o $@ $<
24
 
25
%.o: %.c
26
	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
27
 
28
%.o: %.cc
29
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
30
 
31
%.dd: %.c
32
	$(CC) -MM $(CPPFLAGS) $< > $@
33
 
34
%.dd: %.cc
35
	$(CXX) -MM $(CPPFLAGS) $< > $@
36
 
37
%.d: %.dd
38
	$(FIXDEPS) $* < $< > $@
39
 
40
.DELETE_ON_ERROR:
41
 
42
SSRC = $(wildcard *.s)
43
CSRC = $(wildcard *.c)
44
CCSRC = $(wildcard *.cc)
45
 
46
.PHONY: all
47
all: Wimp
48
 
49
.PHONY: clean
50
clean: always
51
	rm -f Wimp
52
	rm -f $(wildcard *.o)
53
	rm -f $(wildcard *.d)
54
	rm -f $(wildcard *.dd)
55
	rm -f header.h
56
 
57
.PHONY: always
58
 
59
Wimp: $(SSRC:.s=.o) $(CSRC:.c=.o) $(CCSRC:.cc=.o) header.o
60
	$(LD) $(LDFLAGS) -o $@ $^ OSLib:o.OSLib32
61
 
62
header.h header.o: header.cmhg Makefile
63
	$(CMHG) $(CMHGFLAGS) -d h.header -o o.header cmhg.header
64
 
65
$(SSRC:.s=.o) $(CSRC:.c=.o) $(CCSRC:.cc=.o): Makefile
66
$(CSRC:.c=.dd) $(CCSRC:.cc=.dd): header.h
67
 
68
ifneq ($(MAKECMDGOALS),clean)
69
include $(CSRC:.c=.d) $(CCSRC:.cc=.d)
70
endif