Skip to content

Commit

Permalink
Reworked rules.make to be much simpler and faster.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@2626 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
ovidiucp committed Nov 13, 1997
1 parent 6fc18be commit 6162870
Show file tree
Hide file tree
Showing 14 changed files with 380 additions and 437 deletions.
24 changes: 24 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
Wed Nov 12 13:29:24 1997 Ovidiu Predescu <ovidiu@net-community.com>

* common.make (OBJCFLAGS): Removed the -Wno-implicit flag since it
could hide some programming errors.

Tue Nov 11 14:43:56 1997 Adam Fedor <fedor@doc.com>

* target.make (Solaris/BUNDLE_LDFLAGS): Change the flags.

Fri Nov 7 16:33:22 1997 Ovidiu Predescu <ovidiu@net-community.com>

Reworked a bunch of files to be more general and faster.
* clean.make: File removed.
* GNUmakefile.in: Removed the clean.make.
* rules.make: Reworked to be simpler and faster.
* library.make: Reworked for the new rules.make.
* names.make: Likewise.
* objc.make: Likewise.
* tool.make: Likewise.
* application.make: Likewise. Wrote the install target support.

* config.make.in: New definition for TAR.
* test.make (testbundle-resource-files): Added __done at the end of the
for list command so the shell doesn't crash if the list is empty.
* brain.make: Small changes on the OPENSTEP support.
* target.make: Added LIBRARIES_DEPEND_UPON to the list of libraries
for OPENSTEP.

Sat Nov 1 13:17:07 1997 Scott Christley <scottc@net-community.com>

* brain.make: Export LIBRARY_COMBO.
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ install: all
done
$(INSTALL_PROGRAM) -m 755 openapp $(tooldir); \
$(INSTALL_PROGRAM) -m 755 debugapp $(tooldir); \
for f in aggregate.make application.make bundle.make clean.make \
for f in aggregate.make application.make bundle.make \
common.make brain.make library.make rules.make target.make \
tool.make test.make names.make objc.make MediaBook.func; do \
$(INSTALL_DATA) $$f $(makedir); \
Expand Down
78 changes: 58 additions & 20 deletions application.make
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,46 @@ else
endif
endif

ifneq ($(INTERNAL_APP_NAME),)
ifeq ($(INTERNAL_app_NAME),)
# This part gets included by the first invoked make process.
internal-all:: $(APP_NAME:=.all.app.variables)

internal-install:: $(APP_NAME:=.install.app.variables)

internal-uninstall:: $(APP_NAME:=.uninstall.app.variables)

internal-clean:: $(APP_NAME:=.clean.app.variables)

internal-distclean:: $(APP_NAME:=.distclean.app.variables)

$(APP_NAME):
@$(MAKE) --no-print-directory $@.all.app.variables

else

# Libraries that go before the GUI libraries
ALL_GUI_LIBS = $(ADDITIONAL_GUI_LIBS) $(AUXILIARY_GUI_LIBS) $(BACKEND_LIBS) \
$(GUI_LIBS) $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
$(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
$(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)

ALL_GUI_LIBS := \
$(shell $(WHICH_LIB_SCRIPT) $(LIB_DIRS_NO_SYSTEM) $(ALL_GUI_LIBS) \
debug=$(debug) profile=$(profile) shared=$(shared) libext=$(LIBEXT) \
shared_libext=$(SHARED_LIBEXT))


# Don't include these definitions the first time make is invoked. This part is
# included when make is invoked the second time from the %.buildapp rule (see
# included when make is invoked the second time from the %.build rule (see
# rules.make).
APP_DIR_NAME = $(INTERNAL_APP_NAME:=.$(APP_EXTENSION))
APP_DIR_NAME = $(INTERNAL_app_NAME:=.$(APP_EXTENSION))

# Support building NeXT applications
ifneq ($(OBJC_COMPILER), NeXT)
APP_FILE = \
$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)/$(INTERNAL_APP_NAME)$(EXEEXT)
$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)/$(INTERNAL_app_NAME)$(EXEEXT)
else
APP_FILE = $(APP_DIR_NAME)/$(INTERNAL_APP_NAME)$(EXEEXT)
APP_FILE = $(APP_DIR_NAME)/$(INTERNAL_app_NAME)$(EXEEXT)
endif

#
Expand All @@ -69,26 +97,36 @@ $(APP_FILE): $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
ifeq ($(OBJC_COMPILER), NeXT)
# This is a hack for OPENSTEP systems to remove the iconheader file
# automatically generated by the makefile package.
rm -f $(INTERNAL_APP_NAME).iconheader
rm -f $(INTERNAL_app_NAME).iconheader
endif

#
# Compilation targets
#
ifeq ($(OBJC_COMPILER), NeXT)
internal-all:: $(INTERNAL_APP_NAME).iconheader $(GNUSTEP_OBJ_DIR) \
$(APP_DIR_NAME) $(APP_FILE) app-resource-files
internal-app-all:: before-$(TARGET)-all $(INTERNAL_app_NAME).iconheader \
$(GNUSTEP_OBJ_DIR) $(APP_DIR_NAME) $(APP_FILE) app-resource-files \
after-$(TARGET)-all

before-$(TARGET)-all::

$(INTERNAL_APP_NAME).iconheader:
@(echo "F $(INTERNAL_APP_NAME).$(APP_EXTENSION) $(INTERNAL_APP_NAME) $(APP_EXTENSION)"; \
echo "F $(INTERNAL_APP_NAME) $(INTERNAL_APP_NAME) app") >$@
after-$(TARGET)-all::

$(INTERNAL_app_NAME).iconheader:
@(echo "F $(INTERNAL_app_NAME).$(APP_EXTENSION) $(INTERNAL_app_NAME) $(APP_EXTENSION)"; \
echo "F $(INTERNAL_app_NAME) $(INTERNAL_app_NAME) app") >$@

$(APP_DIR_NAME):
mkdir $@
else
internal-all:: $(GNUSTEP_OBJ_DIR) \

internal-app-all:: before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO) $(APP_FILE) \
app-resource-files
app-resource-files after-$(TARGET)-all

before-$(TARGET)-all::

after-$(TARGET)-all::

$(APP_DIR_NAME)/$(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO):
@$(GNUSTEP_MAKEFILES)/mkinstalldirs \
Expand All @@ -101,14 +139,16 @@ app-resource-files::
cp -r $(RESOURCE_FILES) $(APP_DIR_NAME); \
fi)

else
# This part gets included by the first invoked make process.
internal-all:: $(APP_NAME:=.buildapp)
internal-app-install::
$(TAR) cf - $(APP_DIR_NAME) | (cd $(GNUSTEP_APPS); $(TAR) xf -)

internal-app-uninstall::
(cd $(GNUSTEP_APPS); rm -rf $(APP_DIR_NAME))

#
# Cleaning targets
#
internal-clean::
internal-app-clean::
rm -rf $(GNUSTEP_OBJ_PREFIX)/$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(LIBRARY_COMBO)
ifeq ($(OBJC_COMPILER), NeXT)
rm -f *.iconheader
Expand All @@ -120,11 +160,9 @@ else
endif


internal-distclean::
internal-app-distclean::
rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \
static_debug_obj static_profile_obj shared_profile_debug_obj \
static_profile_debug_obj *.app *.debug *.profile *.iconheader

$(APP_NAME):
@$(MAKE) --no-print-directory $@.buildapp
endif
16 changes: 6 additions & 10 deletions brain.make
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,8 @@ FND_DEFINE = -DLIB_FOUNDATION_LIBRARY=1
endif

ifeq ($(FOUNDATION_LIB),nx)
FND_LDFLAGS = -framework Foundation
FND_LIBS =
endif

ifeq ($(FOUNDATION_LIB), nx)
FND_LDFLAGS =
FND_LIBS = -framework Foundation
FND_DEFINE = -DNeXT_Foundation_LIBRARY=1
endif

Expand All @@ -130,14 +127,13 @@ GUI_LIBS = -lgnustep-gui
endif

ifeq ($(GUI_LIB),nx)
ifneq ($(INTERNAL_APP_NAME),)
ifneq ($(INTERNAL_app_NAME),)
# If we're building an application pass the following additional flags to
# the linker
GUI_LDFLAGS = -sectcreate __ICON __header $(INTERNAL_APP_NAME).iconheader \
GUI_LDFLAGS = -sectcreate __ICON __header $(INTERNAL_app_NAME).iconheader \
-segprot __ICON r r -sectcreate __ICON app /NextLibrary/Frameworks/AppKit.framework/Resources/NSDefaultApplicationIcon.tiff \
-framework AppKit
GUI_LIBS =

-framework AppKit
GUI_LIBS =
endif
endif

Expand Down
40 changes: 0 additions & 40 deletions clean.make

This file was deleted.

2 changes: 1 addition & 1 deletion common.make
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ endif
#
# Overridable compilation flags
#
OBJCFLAGS = -Wno-implicit -Wno-import
OBJCFLAGS = -Wno-import
CFLAGS =
OBJ_DIR_PREFIX =

Expand Down
1 change: 1 addition & 0 deletions config.make.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ LEX = lex
INSTALL = @HOST_INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
TAR = tar

# The default library combination
library_combo = @ac_cv_library_combo@
Expand Down
48 changes: 22 additions & 26 deletions library.make
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,31 @@ include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/rules.make
# Where xxx is the name of the library
#

ifeq ($(INTERNAL_LIBRARY_NAME),)
ifeq ($(INTERNAL_library_NAME),)
# This part is included the first time make is invoked.

internal-all:: $(LIBRARY_NAME:=.buildlib)
internal-all:: $(LIBRARY_NAME:=.all.library.variables)

internal-install:: all $(LIBRARY_NAME:=.installlib)
internal-install:: $(LIBRARY_NAME:=.install.library.variables)

internal-uninstall:: $(LIBRARY_NAME:=.uninstalllib)
internal-uninstall:: $(LIBRARY_NAME:=.uninstall.library.variables)

#
# Cleaning targets
#
internal-clean::
rm -rf $(GNUSTEP_OBJ_DIR)
internal-clean:: $(LIBRARY_NAME:=.clean.library.variables)

internal-distclean::
rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \
static_debug_obj static_profile_obj shared_profile_debug_obj \
static_profile_debug_obj
internal-distclean:: $(LIBRARY_NAME:=.distclean.library.variables)

$(LIBRARY_NAME):
@$(MAKE) --no-print-directory $@.buildlib
@$(MAKE) --no-print-directory $@.all.library.variables

else
# This part gets included the second time make is invoked.

ifeq ($(shared), yes)
LIBRARY_FILE = $(INTERNAL_LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
LIBRARY_FILE = $(INTERNAL_library_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
LIBRARY_FILE_EXT=$(SHARED_LIBEXT)
VERSION_LIBRARY_FILE = $(LIBRARY_FILE).$(VERSION)
else
LIBRARY_FILE = $(INTERNAL_LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(LIBEXT)
LIBRARY_FILE = $(INTERNAL_library_NAME)$(LIBRARY_NAME_SUFFIX)$(LIBEXT)
LIBRARY_FILE_EXT=$(LIBEXT)
VERSION_LIBRARY_FILE = $(LIBRARY_FILE)
endif
Expand All @@ -85,22 +78,25 @@ endif
#
# Compilation targets
#
internal-all:: $(GNUSTEP_OBJ_DIR) $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) \
import-library
internal-library-all:: before-$(TARGET)-all $(GNUSTEP_OBJ_DIR) \
$(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) import-library \
after-$(TARGET)-all

$(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE): $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LIB_LINK_CMD)

before-$(TARGET)-all::

after-$(TARGET)-all::

import-library::

#
# Install and uninstall targets
#
internal-install:: internal-install-dirs internal-install-lib \
internal-library-install:: internal-install-dirs internal-install-lib \
internal-install-headers

before-install:: all

internal-install-dirs::
$(GNUSTEP_MAKEFILES)/mkinstalldirs \
$(GNUSTEP_LIBRARIES_ROOT)/$(GNUSTEP_TARGET_DIR) \
Expand Down Expand Up @@ -130,7 +126,7 @@ internal-install-lib::

internal-install-import-lib::

internal-uninstall:: internal-uninstall-headers internal-uninstall-lib
internal-library-uninstall:: internal-uninstall-headers internal-uninstall-lib

internal-uninstall-headers::
for file in $(HEADER_FILES); do \
Expand All @@ -149,17 +145,17 @@ internal-uninstall-import-lib::
#
# Cleaning targets
#
internal-clean::
rm -rf $(GNUSTEP_OBJ_PREFIX)
internal-library-clean::
rm -rf $(GNUSTEP_OBJ_DIR)

internal-distclean::
internal-library-distclean::
rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \
static_debug_obj static_profile_obj shared_profile_debug_obj \
static_profile_debug_obj

#
# Testing targets
#
internal-check::
internal-library-check::

endif
Loading

0 comments on commit 6162870

Please sign in to comment.