the annoying make problem (split from: C++ conversion)

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
Jenalya
TMW Adviser
TMW Adviser
Posts: 717
Joined: 22 Sep 2010, 19:28

the annoying make problem (split from: C++ conversion)

Post by Jenalya »

Not entirely on-topic, but while trying around to compile the cxx branch, it was really annoying to have to do
mkdir -p obj/{common,login,char,map,ladmin,tool} after each make clean, so what do you think about this (created with help of Pjotr Orial):

Code: Select all

From 1341e53a28a9859fbce2883ea26b56e46b5aeadc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jessica=20T=C3=B6lke?= <jtoelke@mail.upb.de>
Date: Tue, 18 Sep 2012 22:44:27 +0200
Subject: [PATCH] Create needed directories via makefile.

---
 GNUmakefile |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index a8914f8..13bef01 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,7 +1,8 @@
 #! /usr/bin/make -f
 SHELL=/bin/bash
 BUILD_DIR = obj
-default: login-server char-server map-server ladmin eathena-monitor
+default: dir
+	$(MAKE) login-server char-server map-server ladmin eathena-monitor
 .DELETE_ON_ERROR:
 include make.defs
 
@@ -42,6 +43,8 @@ clean:
 	rm -rf ${PROGS} ${BUILD_DIR}/
 common: ${BUILD_DIR}/common/core.o ${BUILD_DIR}/common/db.o ${BUILD_DIR}/common/grfio.o ${BUILD_DIR}/common/lock.o ${BUILD_DIR}/common/md5calc.o ${BUILD_DIR}/common/mt_rand.o ${BUILD_DIR}/common/nullpo.o ${BUILD_DIR}/common/socket.o ${BUILD_DIR}/common/timer.o ${BUILD_DIR}/common/utils.o
 
+dir:
+	mkdir -p obj/{common,login,char,map,ladmin,tool}
 # Top level programs
 login-server: ${BUILD_DIR}/login/login
 	cp -f $< $@
-- 
1.7.9.5
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: the annoying make problem (split from: C++ conversion)

Post by o11c »

What about just adding the "make dir" target, which would have to be called manually? That avoids the recursive call (recursive make == bad).

I do have a working replacement build system that fixes this among other problems, but I want to polish it a bit more and I need to rewrite the related "configure" a few times.
Former programmer for the TMWA server.
User avatar
Jenalya
TMW Adviser
TMW Adviser
Posts: 717
Joined: 22 Sep 2010, 19:28

Re: the annoying make problem (split from: C++ conversion)

Post by Jenalya »

o11c wrote:What about just adding the "make dir" target, which would have to be called manually? That avoids the recursive call (recursive make == bad).
Though that'd be better than nothing, it's still cumbersome. And for people who are new to the project still a possible source of confusing compiling problems.
What problem could be caused by the recursive call in this case?
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: the annoying make problem (split from: C++ conversion)

Post by o11c »

I managed to bypass the dreaded normalization stage of make 3.81, and have pushed a fix on the 'test' and 'cxx' branches (which are currently identical).

I haven't tested with make 3.82 yet, but I'm pretty sure it won't break anything. I will test before pushing to master, of course.
Former programmer for the TMWA server.
Post Reply