Skip to content
Snippets Groups Projects
Commit 10fc0646 authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: 'make clean' failed for wmake/src

- caused by the typo '@E' instead of '$E' (commit 997f1713)

ENH: minor improvements for wmake/src makefile

- 'make clean' now also tries to remove the parent platforms/
  directory if possible.

- the flex intermediate build target is placed into the platforms/
  directory to avoid touching the src/ directory at all.

- suppress warnings about unused functions (GCC only)
parent 2bfd17cf
No related merge requests found
#------------------------------------------------------------------------------
#----------------------------*- makefile-gmake -*------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
......@@ -57,22 +57,26 @@ include $(GENERAL_RULES)/general
# Targets
#------------------------------------------------------------------------------
.PHONY: all clean
all: $(WMAKE_BIN)/dirToString $(WMAKE_BIN)/wmkdep
@echo built wmake-bin for $(WM_ARCH)$(WM_COMPILER)
clean:
@E rm -f $(WMAKE_BIN)/* 2>/dev/null
@echo clean wmake-bin for $(WM_ARCH)$(WM_COMPILER)
@rm -rf $(WMAKE_BIN) 2>/dev/null
@rmdir $(shell dirname $(WMAKE_BIN)) 2>/dev/null || true
$(WMAKE_BIN)/dirToString: dirToString.c
@mkdir -p $(WMAKE_BIN)
$(call QUIET_MESSAGE,compile,$<)
$E $(cc) $(cFLAGS) dirToString.c -o $(WMAKE_BIN)/dirToString
$(call QUIET_MESSAGE,compile,$(<F))
$E $(cc) $(cFLAGS) $(<F) -o $@
$(WMAKE_BIN)/wmkdep: wmkdep.l
@mkdir -p $(WMAKE_BIN)
$(call QUIET_MESSAGE,lex,$<)
$E flex wmkdep.l; \
$(cc) $(cFLAGS) lex.yy.c -o $(WMAKE_BIN)/wmkdep
@rm -f lex.yy.c 2>/dev/null
$(call QUIET_MESSAGE,flex,$(<F))
$E flex -o $@.c $(<F) && $(cc) $(cFLAGS) $@.c -o $@
@rm -f $@.c 2>/dev/null
#------------------------------------------------------------------------------
......@@ -46,19 +46,18 @@ Usage
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h> // POSIX
#include <dirent.h> // POSIX
void nextFile(const char* fileName);
void importFile(const char* fileName);
void importDir(const char* dirName);
#undef yywrap /* sometimes a macro by default */
#include <sys/types.h> /* POSIX */
#include <dirent.h> /* POSIX */
/* The executable name (for messages), without requiring access to argv[] */
#define EXENAME "wmkdep"
#undef yywrap /* sometimes a macro by default */
#define YY_NO_INPUT /* no input(), yyinput() required */
#pragma GCC diagnostic ignored "-Wunused-function"
void nextFile(const char* fileName);
/*---------------------------------------------------------------------------*/
%}
%x CMNT CFNAME SCFNAME JFNAME FFNAME
......@@ -80,6 +79,8 @@ void importDir(const char* dirName);
%%
/*---------------------------------------------------------------------------*/
/* char* entry in hash table */
struct HashEntry
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment