Subversion Repositories WindowManager

Compare Revisions

Ignore whitespace Rev 2 → Rev 3

/trunk/wimp/Makefile
New file
0,0 → 1,70
# This file is part of the free Window Manager module.
# Copyright © 2007 Graham Shaw.
# Redistribution and modification are permitted within the terms of the
# GNU General Public License (version 2 or any later version).
 
AS = as
CC = gcc
CXX = g++
LD = g++
CMHG = cmunge
FIXDEPS = fixdeps
 
CPPFLAGS = -IOSLib:
CFLAGS = -mthrowback -mlibscl -mmodule -O2 \
-Wall -W -Wno-unused -Wno-uninitialized
CXXFLAGS = -mthrowback -mlibscl -mmodule -fno-exceptions -O2 \
-Wall -W -Wno-unused -Wno-uninitialized
ASFLAGS = -throwback -objasm -module -apcs32 -apcsfpv3 -target xscale -IOSLib:
LDFLAGS = -mlibscl -mmodule
CMHGFLAGS = -zoslib -zbase -tgcc -32bit
 
%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
 
%.o: %.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
 
%.o: %.cc
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
 
%.dd: %.c
$(CC) -MM $(CPPFLAGS) $< > $@
 
%.dd: %.cc
$(CXX) -MM $(CPPFLAGS) $< > $@
 
%.d: %.dd
$(FIXDEPS) $* < $< > $@
 
.DELETE_ON_ERROR:
 
SSRC = $(wildcard *.s)
CSRC = $(wildcard *.c)
CCSRC = $(wildcard *.cc)
 
.PHONY: all
all: Wimp
 
.PHONY: clean
clean: always
rm -f Wimp
rm -f $(wildcard *.o)
rm -f $(wildcard *.d)
rm -f $(wildcard *.dd)
rm -f header.h
 
.PHONY: always
 
Wimp: $(SSRC:.s=.o) $(CSRC:.c=.o) $(CCSRC:.cc=.o) header.o
$(LD) $(LDFLAGS) -o $@ $^ OSLib:o.OSLib32
 
header.h header.o: header.cmhg Makefile
$(CMHG) $(CMHGFLAGS) -d h.header -o o.header cmhg.header
 
$(SSRC:.s=.o) $(CSRC:.c=.o) $(CCSRC:.cc=.o): Makefile
$(CSRC:.c=.dd) $(CCSRC:.cc=.dd): header.h
 
ifneq ($(MAKECMDGOALS),clean)
include $(CSRC:.c=.d) $(CCSRC:.cc=.d)
endif