mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
2003-01-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
* tools/rtouch.c: New file. * rules.mak (ROS_USE_PCH): Default to no. (RTOUCH): Define. * tools/Makefile: Add rtouch utility. * tools/helper.mk: Support precompiled headers. svn path=/trunk/; revision=4006
This commit is contained in:
parent
8b09e17d3f
commit
f63e1913da
5 changed files with 125 additions and 5 deletions
|
@ -1,3 +1,11 @@
|
|||
2003-01-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||
|
||||
* tools/rtouch.c: New file.
|
||||
* rules.mak (ROS_USE_PCH): Default to no.
|
||||
(RTOUCH): Define.
|
||||
* tools/Makefile: Add rtouch utility.
|
||||
* tools/helper.mk: Support precompiled headers.
|
||||
|
||||
2003-01-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||
|
||||
* ntoskrnl/dbg/profile.c: New file.
|
||||
|
|
|
@ -8,6 +8,11 @@ ifeq ($(HOST),)
|
|||
HOST = mingw32-windows
|
||||
endif
|
||||
|
||||
# Default to no PCH support
|
||||
ifeq ($(ROS_USE_PCH),)
|
||||
ROS_USE_PCH = no
|
||||
endif
|
||||
|
||||
# uncomment if you use bochs and it displays only 30 rows
|
||||
# BOCHS_30ROWS = yes
|
||||
|
||||
|
@ -77,6 +82,7 @@ RM = $(TOOLS_PATH)/rdel
|
|||
RMDIR = $(TOOLS_PATH)/rrmdir
|
||||
RMKDIR = $(TOOLS_PATH)/rmkdir
|
||||
RSYM = $(TOOLS_PATH)/rsym
|
||||
RTOUCH = $(TOOLS_PATH)/rtouch
|
||||
MC = $(TOOLS_PATH)/wmc/wmc
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,8 @@ TOOLS = \
|
|||
rdel$(EXE_POSTFIX) \
|
||||
rmkdir$(EXE_POSTFIX) \
|
||||
rrmdir$(EXE_POSTFIX) \
|
||||
rsym$(EXE_POSTFIX)
|
||||
rsym$(EXE_POSTFIX) \
|
||||
rtouch$(EXE_POSTFIX)
|
||||
|
||||
CLEAN_FILES = $(TOOLS)
|
||||
|
||||
|
@ -59,6 +60,16 @@ rsym$(EXE_POSTFIX): rsym.c
|
|||
$(HOST_CC) $(CFLAGS) -DDOS_PATHS rsym.c -o rsym$(EXE_POSTFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),mingw32-linux)
|
||||
rtouch$(EXE_POSTFIX): rtouch.c
|
||||
$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rtouch.c -o rtouch$(EXE_POSTFIX)
|
||||
endif
|
||||
ifeq ($(HOST),mingw32-windows)
|
||||
rtouch$(EXE_POSTFIX): rtouch.c
|
||||
$(HOST_CC) $(CFLAGS) -DDOS_PATHS rtouch.c -o rtouch$(EXE_POSTFIX)
|
||||
endif
|
||||
|
||||
|
||||
wmc_directory_target:
|
||||
make -C wmc wmc$(EXE_POSTFIX)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: helper.mk,v 1.25 2003/01/07 17:39:58 robd Exp $
|
||||
# $Id: helper.mk,v 1.26 2003/01/15 20:18:12 chorns Exp $
|
||||
#
|
||||
# Helper makefile for ReactOS modules
|
||||
# Variables this makefile accepts:
|
||||
|
@ -39,6 +39,7 @@
|
|||
# $TARGET_NORC = Do not include standard resource file (no,yes) (optional)
|
||||
# $TARGET_LIBPATH = Destination path for import libraries (optional)
|
||||
# $TARGET_INSTALLDIR = Destination path when installed (optional)
|
||||
# $TARGET_PCH = Filename of header to use to generate a PCH if supported by the compiler (optional)
|
||||
# $WINE_MODE = Compile using WINE headers (no,yes) (optional)
|
||||
# $WINE_RC = Name of .rc file for WINE modules (optional)
|
||||
|
||||
|
@ -591,7 +592,7 @@ endif
|
|||
MK_CLEANFILES := $(filter %.o,$(MK_OBJECTS))
|
||||
|
||||
clean:
|
||||
- $(RM) *.o $(MK_BASENAME).sym $(MK_BASENAME).a $(TARGET_PATH)/$(MK_RES_BASE).coff \
|
||||
- $(RM) *.o depend.d *.pch $(MK_BASENAME).sym $(MK_BASENAME).a $(TARGET_PATH)/$(MK_RES_BASE).coff \
|
||||
$(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) \
|
||||
junk.tmp base.tmp temp.exp \
|
||||
$(TARGET_CLEAN)
|
||||
|
@ -626,14 +627,40 @@ $(DIST_DIR)/$(MK_DISTDIR)/$(MK_FULLNAME): $(MK_FULLNAME)
|
|||
$(CP) $(MK_FULLNAME) $(DIST_DIR)/$(MK_DISTDIR)/$(MK_FULLNAME)
|
||||
$(CP) $(MK_BASENAME).sym $(DIST_DIR)/symbols/$(MK_BASENAME).sym
|
||||
|
||||
|
||||
endif # MK_IMPLIBONLY
|
||||
|
||||
|
||||
.phony: all depends implib clean install dist depends
|
||||
|
||||
|
||||
%.o: %.c
|
||||
# Precompiled header support
|
||||
# When using PCHs, use dependency tracking to keep the .pch files up-to-date.
|
||||
|
||||
MK_PCHNAME =
|
||||
ifeq ($(ROS_USE_PCH),yes)
|
||||
ifneq ($(TARGET_PCH),)
|
||||
MK_PCHNAME = $(TARGET_PCH).pch
|
||||
|
||||
# GCC generates wrong dependencies for header files.
|
||||
MK_PCHFAKE = $(TARGET_PCH:.h=.o)
|
||||
$(MK_PCHFAKE):
|
||||
- $(RTOUCH) $(MK_PCHFAKE)
|
||||
|
||||
$(MK_PCHNAME): depend.d
|
||||
- $(RTOUCH) $(MK_PCHNAME)
|
||||
- $(CC) $(TARGET_CFLAGS) $(TARGET_PCH)
|
||||
|
||||
depend.d: $(MK_PCHFAKE)
|
||||
- $(RTOUCH) depend.d
|
||||
- $(CC) $(TARGET_CFLAGS) $(TARGET_PCH) -M -MF depend.d
|
||||
|
||||
include depend.d
|
||||
|
||||
endif # TARGET_PCH
|
||||
endif # ROS_USE_PCH
|
||||
|
||||
|
||||
%.o: %.c $(MK_PCHNAME)
|
||||
$(CC) $(TARGET_CFLAGS) -c $< -o $@
|
||||
%.o: %.cc
|
||||
$(CC) $(TARGET_CPPFLAGS) -c $< -o $@
|
||||
|
|
68
reactos/tools/rtouch.c
Executable file
68
reactos/tools/rtouch.c
Executable file
|
@ -0,0 +1,68 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <utime.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
char* convert_path(char* origpath)
|
||||
{
|
||||
char* newpath;
|
||||
int i;
|
||||
|
||||
newpath = (char *)strdup(origpath);
|
||||
|
||||
i = 0;
|
||||
while (newpath[i] != 0)
|
||||
{
|
||||
#ifdef UNIX_PATHS
|
||||
if (newpath[i] == '\\')
|
||||
{
|
||||
newpath[i] = '/';
|
||||
}
|
||||
#else
|
||||
#ifdef DOS_PATHS
|
||||
if (newpath[i] == '/')
|
||||
{
|
||||
newpath[i] = '\\';
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
i++;
|
||||
}
|
||||
return(newpath);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
char* path;
|
||||
FILE* file;
|
||||
time_t now;
|
||||
struct utimbuf fnow;
|
||||
|
||||
if (argc != 2)
|
||||
{
|
||||
fprintf(stderr, "Wrong number of arguments.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
path = convert_path(argv[1]);
|
||||
file = (FILE *)open(path, S_IWRITE);
|
||||
if (file == (void*)-1)
|
||||
{
|
||||
file = (FILE *)open(path, S_IWRITE | O_CREAT);
|
||||
if (file == (void*)-1)
|
||||
{
|
||||
fprintf(stderr, "Cannot create file.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
close(file);
|
||||
|
||||
now = time();
|
||||
fnow.actime = now;
|
||||
fnow.modtime = now;
|
||||
(int) utime(path, &fnow);
|
||||
|
||||
exit(0);
|
||||
}
|
Loading…
Reference in a new issue