C-code

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply
Seb McClouth

C-code

Post by Seb McClouth » Fri Sep 02, 2005 9:12 am

Hello everybody

For my project (Qbinux, ofcourse), I'll be posting every now and then some c-code. I would hope then you ppl who know c can help me translate it to QB, if, ofcourse, there is a Qb-alternative, if not, maybe we can find one 2gether.

grtz
Seb

Seb McClouth

Post by Seb McClouth » Fri Sep 02, 2005 10:43 am

Okay the first one:

Makefiles:

If I have the following makefile...

How can I achieve something similair with PDS?

Code: Select all

VERSION = 1
PATCHLEVEL = 0
SUBLEVEL = 9
 
all:    Version zImage
 
.EXPORT_ALL_VARIABLES:
 
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
           else if [ -x /bin/bash ]; then echo /bin/bash; \
           else echo sh; fi ; fi)
 
#
# Make "config" the default target if there is no configuration file or
# "depend" the target if there is no top-level dependency information.
#
ifeq (.config,$(wildcard .config))
include .config
ifeq (.depend,$(wildcard .depend))
include .depend
else
CONFIGURATION = depend
endif
else
CONFIGURATION = config
endif
 
ifdef CONFIGURATION
CONFIGURE = dummy
endif

#
# ROOT_DEV specifies the default root-device when making the image.
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
# the default of FLOPPY is used by 'build'.
#
 
ROOT_DEV = CURRENT
 
#
# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.
#

SVGA_MODE=      -DSVGA_MODE=NORMAL_VGA
 
#
# standard CFLAGS
#
 
CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe
 
ifdef CONFIG_CPP
CFLAGS := $(CFLAGS) -x c++
endif
 
ifdef CONFIG_M486
CFLAGS := $(CFLAGS) -m486
else
CFLAGS := $(CFLAGS) -m386
endif
 
AS86    =as86 -0 -a
LD86    =ld86 -0

AS      =as
LD      =ld
LDFLAGS =#-qmagic
HOSTCC  =gcc
CC      =gcc -D__KERNEL__
MAKE    =make
CPP     =$(CC) -E
AR      =ar
STRIP   =strip
 
ARCHIVES        =kernel/kernel.o mm/mm.o fs/fs.o net/net.o ipc/ipc.o
FILESYSTEMS     =fs/filesystems.a
DRIVERS         =drivers/block/block.a \
                  drivers/char/char.a \
                  drivers/net/net.a \
                  ibcs/ibcs.o
LIBS            =lib/lib.a
SUBDIRS         =kernel drivers mm fs net ipc ibcs lib
 
KERNELHDRS      =/usr/src/linux/include
grtz
Seb

Post Reply