This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-goldedplus/GNUmakef.inc

90 lines
2.7 KiB
PHP
Raw Normal View History

2000-02-25 10:15:17 +00:00
# -*- makefile -*-
# $Id$
# Include file for GNU C++ build
2000-02-25 10:15:17 +00:00
2002-06-10 06:24:11 +00:00
.PHONY: all clean sourcelist
2000-02-25 10:15:17 +00:00
all: $(TARGET)
include $(TOP)/GNUmakef.def
# Messagebase formats
include $(TOP)/MSGBase.def
# Config files formats
include $(TOP)/Config.def
2000-02-25 10:15:17 +00:00
FOBJPATH=$(TOP)/$(OBJPATH)/$(PLATFORM)/$(TARGET)
2002-06-10 06:24:11 +00:00
FDEPPATH=$(TOP)/$(OBJPATH)/$(PLATFORM)/$(TARGET)
2000-02-25 10:15:17 +00:00
FLIBPATH=$(TOP)/$(LIBPATH)/$(PLATFORM)
.SUFFIXES: .c .cpp .all .rc .cxx
2000-02-25 10:15:17 +00:00
2001-05-27 19:28:13 +00:00
sourcelist: bld$(PLATFORM).inc
2000-02-25 10:15:17 +00:00
bld$(PLATFORM).inc: $(TARGET).all
@echo making sourcelist
@$(GREP) -w $(PLATFORM) $< \
| $(SED) 's;^\([[:alnum:]_]*\)[ ]*\([[:alnum:]_]*\).*;SOURCES+=\1.\2;' > $@; [ -s $@ ] || rm -f $@
2000-02-25 10:15:17 +00:00
$(FOBJPATH)/%$(OBJEXT): %.cpp
@echo building $(basename $<)$(OBJEXT)
$(CXX) -c -MD $(CPPFLAGS) -o $@ $<
2002-06-10 06:24:11 +00:00
@$(SHELL) -c "[ -s $(patsubst %.cpp,%.d,$<) ] && \
echo -n $(FOBJPATH)/>$(FDEPPATH)/$(patsubst %.cpp,%.d,$<) && \
$(CAT) $(patsubst %.cpp,%.d,$<)>>$(FDEPPATH)/$(patsubst %.cpp,%.d,$<) &&\
rm $(patsubst %.cpp,%.d,$<) || true"
2000-02-25 10:15:17 +00:00
$(FOBJPATH)/%$(OBJEXT): %.cxx
@echo building $(basename $<)$(OBJEXT)
$(CXX) -c -MD $(CPPFLAGS) -o $@ $<
@$(SHELL) -c "[ -s $(patsubst %.cxx,%.d,$<) ] && \
echo -n $(FOBJPATH)/>$(FDEPPATH)/$(patsubst %.cxx,%.d,$<) && \
$(CAT) $(patsubst %.cxx,%.d,$<)>>$(FDEPPATH)/$(patsubst %.cxx,%.d,$<) &&\
rm $(patsubst %.cxx,%.d,$<) || true"
2001-05-27 19:28:13 +00:00
$(FOBJPATH)/%$(OBJEXT): %.c
@echo building $(basename $<)$(OBJEXT)
$(CC) -c -MD $(CFLAGS) -o $@ $<
2002-06-10 06:24:11 +00:00
@$(SHELL) -c "[ -s $(patsubst %.c,%.d,$<) ] && \
echo -n $(FOBJPATH)/>$(FDEPPATH)/$(patsubst %.c,%.d,$<) && \
$(CAT) $(patsubst %.c,%.d,$<)>>$(FDEPPATH)/$(patsubst %.c,%.d,$<) && \
rm $(patsubst %.c,%.d,$<) || true"
2001-05-27 19:28:13 +00:00
ifeq ($(PLATFORM),cyg)
$(FOBJPATH)/%$(OBJEXT): %.rc
@echo creating resources
@$(WINDRES) --use-temp-file -o $@ $<
2001-05-27 19:28:13 +00:00
endif
ifeq ($(PLATFORM),emx)
$(FOBJPATH)/%.res: %.rc
@echo creating resources
@rc $(subst -I,-i ,$(INCS)) -x1 -r $<
endif
SOURCES=
2002-06-10 06:24:11 +00:00
ifeq ($(wildcard $(TOP)/$(OBJPATH)/$(PLATFORM)/source.ls?),$(TOP)/$(OBJPATH)/$(PLATFORM)/source.lst)
2001-05-27 19:28:13 +00:00
include bld$(PLATFORM).inc
endif
ifeq ($(PLATFORM),cyg)
OBJS=$(addprefix $(FOBJPATH)/,$(patsubst %.rc,%$(OBJEXT),$(patsubst %.c,%$(OBJEXT),$(patsubst %.cpp,%$(OBJEXT),$(patsubst %.cxx,%$(OBJEXT),$(filter %.c %.cpp %.cxx %.rc,$(SOURCES)))))))
2001-05-27 19:28:13 +00:00
else
ifeq ($(PLATFORM),emx)
OBJS=$(addprefix $(FOBJPATH)/,$(patsubst %.rc,%.res,$(patsubst %.c,%$(OBJEXT),$(patsubst %.cpp,%$(OBJEXT),$(patsubst %.cxx,%$(OBJEXT),$(filter %.c %.cpp %.cxx %.rc,$(SOURCES)))))))
2001-05-27 19:28:13 +00:00
else
OBJS=$(addprefix $(FOBJPATH)/,$(patsubst %.c,%$(OBJEXT),$(patsubst %.cpp,%$(OBJEXT),$(patsubst %.cxx,%$(OBJEXT),$(filter %.c %.cpp %.cxx %.rc,$(SOURCES))))))
2001-05-27 19:28:13 +00:00
endif
endif
2002-06-10 06:24:11 +00:00
DEPS = $(wildcard $(FDEPPATH)/*.d)
ALLOBJS = $(wildcard $(FOBJPATH)/*.o)
2001-05-27 19:28:13 +00:00
clean:
@echo cleaning...
2002-06-10 06:24:11 +00:00
@-rm -f $(ALLOBJS) $(DEPS) bld$(PLATFORM).inc
2001-05-27 19:28:13 +00:00
ifneq ($(DEPS),)
2002-06-10 06:24:11 +00:00
-include $(DEPS)
2001-05-27 19:28:13 +00:00
endif